How can I trigger a Python code automatically?












0















I have a code in Oracle which is optimized and create weekly data. The problem is I also want my Oracle code trigger Python to run and create data in Python and save. Is there any possibility to execute my Python code automatically?










share|improve this question


















  • 1





    If you're on linux cron job would be good.

    – Vineeth Sai
    Nov 1 '18 at 6:30













  • no, I'm not :( do you know any solution to handle it in Windows

    – isikb
    Nov 1 '18 at 6:41











  • On windows the Task scheduler can be used in order to rerun tasks stackoverflow.com/questions/4437701/…

    – quant
    Nov 1 '18 at 7:16











  • possible duplicate of stackoverflow.com/questions/48085250/…

    – quant
    Nov 1 '18 at 7:21











  • "trigger Python to run and create data in Python and save". When will the python code run? Where will the python code save the data it creates?

    – APC
    Nov 1 '18 at 8:22
















0















I have a code in Oracle which is optimized and create weekly data. The problem is I also want my Oracle code trigger Python to run and create data in Python and save. Is there any possibility to execute my Python code automatically?










share|improve this question


















  • 1





    If you're on linux cron job would be good.

    – Vineeth Sai
    Nov 1 '18 at 6:30













  • no, I'm not :( do you know any solution to handle it in Windows

    – isikb
    Nov 1 '18 at 6:41











  • On windows the Task scheduler can be used in order to rerun tasks stackoverflow.com/questions/4437701/…

    – quant
    Nov 1 '18 at 7:16











  • possible duplicate of stackoverflow.com/questions/48085250/…

    – quant
    Nov 1 '18 at 7:21











  • "trigger Python to run and create data in Python and save". When will the python code run? Where will the python code save the data it creates?

    – APC
    Nov 1 '18 at 8:22














0












0








0








I have a code in Oracle which is optimized and create weekly data. The problem is I also want my Oracle code trigger Python to run and create data in Python and save. Is there any possibility to execute my Python code automatically?










share|improve this question














I have a code in Oracle which is optimized and create weekly data. The problem is I also want my Oracle code trigger Python to run and create data in Python and save. Is there any possibility to execute my Python code automatically?







python oracle optimization triggers






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 1 '18 at 6:22









isikbisikb

132




132








  • 1





    If you're on linux cron job would be good.

    – Vineeth Sai
    Nov 1 '18 at 6:30













  • no, I'm not :( do you know any solution to handle it in Windows

    – isikb
    Nov 1 '18 at 6:41











  • On windows the Task scheduler can be used in order to rerun tasks stackoverflow.com/questions/4437701/…

    – quant
    Nov 1 '18 at 7:16











  • possible duplicate of stackoverflow.com/questions/48085250/…

    – quant
    Nov 1 '18 at 7:21











  • "trigger Python to run and create data in Python and save". When will the python code run? Where will the python code save the data it creates?

    – APC
    Nov 1 '18 at 8:22














  • 1





    If you're on linux cron job would be good.

    – Vineeth Sai
    Nov 1 '18 at 6:30













  • no, I'm not :( do you know any solution to handle it in Windows

    – isikb
    Nov 1 '18 at 6:41











  • On windows the Task scheduler can be used in order to rerun tasks stackoverflow.com/questions/4437701/…

    – quant
    Nov 1 '18 at 7:16











  • possible duplicate of stackoverflow.com/questions/48085250/…

    – quant
    Nov 1 '18 at 7:21











  • "trigger Python to run and create data in Python and save". When will the python code run? Where will the python code save the data it creates?

    – APC
    Nov 1 '18 at 8:22








1




1





If you're on linux cron job would be good.

– Vineeth Sai
Nov 1 '18 at 6:30







If you're on linux cron job would be good.

– Vineeth Sai
Nov 1 '18 at 6:30















no, I'm not :( do you know any solution to handle it in Windows

– isikb
Nov 1 '18 at 6:41





no, I'm not :( do you know any solution to handle it in Windows

– isikb
Nov 1 '18 at 6:41













On windows the Task scheduler can be used in order to rerun tasks stackoverflow.com/questions/4437701/…

– quant
Nov 1 '18 at 7:16





On windows the Task scheduler can be used in order to rerun tasks stackoverflow.com/questions/4437701/…

– quant
Nov 1 '18 at 7:16













possible duplicate of stackoverflow.com/questions/48085250/…

– quant
Nov 1 '18 at 7:21





possible duplicate of stackoverflow.com/questions/48085250/…

– quant
Nov 1 '18 at 7:21













"trigger Python to run and create data in Python and save". When will the python code run? Where will the python code save the data it creates?

– APC
Nov 1 '18 at 8:22





"trigger Python to run and create data in Python and save". When will the python code run? Where will the python code save the data it creates?

– APC
Nov 1 '18 at 8:22












3 Answers
3






active

oldest

votes


















0














You can trigger python script by setting up a cron job.



You can do this using python and crontab: see this documentation https://pypi.org/project/python-crontab/






share|improve this answer
























  • will it help in Windows?

    – isikb
    Nov 1 '18 at 6:45











  • Yes it will work in windows

    – user3698971
    Nov 1 '18 at 7:00



















0














you can use crons jon, task schedule to run the script in particular time. If you want to run the script as service you can use celery and crontab module.






share|improve this answer
























  • does it help me to run my code without running it? my main point is to execute my Oracle code to run python automatically.

    – isikb
    Nov 1 '18 at 6:50



















0














Another solution is to leave Python running, and let a Continuous Query Notification (CQN) callback from the data change invoke a python method. Or use Oracle Advanced Queues for the same. Examples are in https://github.com/oracle/python-cx_Oracle/tree/master/samples



You could also use the DB's UTL_HTTP functionality to invoke a web service that runs python.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53096146%2fhow-can-i-trigger-a-python-code-automatically%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You can trigger python script by setting up a cron job.



    You can do this using python and crontab: see this documentation https://pypi.org/project/python-crontab/






    share|improve this answer
























    • will it help in Windows?

      – isikb
      Nov 1 '18 at 6:45











    • Yes it will work in windows

      – user3698971
      Nov 1 '18 at 7:00
















    0














    You can trigger python script by setting up a cron job.



    You can do this using python and crontab: see this documentation https://pypi.org/project/python-crontab/






    share|improve this answer
























    • will it help in Windows?

      – isikb
      Nov 1 '18 at 6:45











    • Yes it will work in windows

      – user3698971
      Nov 1 '18 at 7:00














    0












    0








    0







    You can trigger python script by setting up a cron job.



    You can do this using python and crontab: see this documentation https://pypi.org/project/python-crontab/






    share|improve this answer













    You can trigger python script by setting up a cron job.



    You can do this using python and crontab: see this documentation https://pypi.org/project/python-crontab/







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 1 '18 at 6:39









    user3698971user3698971

    77129




    77129













    • will it help in Windows?

      – isikb
      Nov 1 '18 at 6:45











    • Yes it will work in windows

      – user3698971
      Nov 1 '18 at 7:00



















    • will it help in Windows?

      – isikb
      Nov 1 '18 at 6:45











    • Yes it will work in windows

      – user3698971
      Nov 1 '18 at 7:00

















    will it help in Windows?

    – isikb
    Nov 1 '18 at 6:45





    will it help in Windows?

    – isikb
    Nov 1 '18 at 6:45













    Yes it will work in windows

    – user3698971
    Nov 1 '18 at 7:00





    Yes it will work in windows

    – user3698971
    Nov 1 '18 at 7:00













    0














    you can use crons jon, task schedule to run the script in particular time. If you want to run the script as service you can use celery and crontab module.






    share|improve this answer
























    • does it help me to run my code without running it? my main point is to execute my Oracle code to run python automatically.

      – isikb
      Nov 1 '18 at 6:50
















    0














    you can use crons jon, task schedule to run the script in particular time. If you want to run the script as service you can use celery and crontab module.






    share|improve this answer
























    • does it help me to run my code without running it? my main point is to execute my Oracle code to run python automatically.

      – isikb
      Nov 1 '18 at 6:50














    0












    0








    0







    you can use crons jon, task schedule to run the script in particular time. If you want to run the script as service you can use celery and crontab module.






    share|improve this answer













    you can use crons jon, task schedule to run the script in particular time. If you want to run the script as service you can use celery and crontab module.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 1 '18 at 6:44









    PratikPratik

    265




    265













    • does it help me to run my code without running it? my main point is to execute my Oracle code to run python automatically.

      – isikb
      Nov 1 '18 at 6:50



















    • does it help me to run my code without running it? my main point is to execute my Oracle code to run python automatically.

      – isikb
      Nov 1 '18 at 6:50

















    does it help me to run my code without running it? my main point is to execute my Oracle code to run python automatically.

    – isikb
    Nov 1 '18 at 6:50





    does it help me to run my code without running it? my main point is to execute my Oracle code to run python automatically.

    – isikb
    Nov 1 '18 at 6:50











    0














    Another solution is to leave Python running, and let a Continuous Query Notification (CQN) callback from the data change invoke a python method. Or use Oracle Advanced Queues for the same. Examples are in https://github.com/oracle/python-cx_Oracle/tree/master/samples



    You could also use the DB's UTL_HTTP functionality to invoke a web service that runs python.






    share|improve this answer




























      0














      Another solution is to leave Python running, and let a Continuous Query Notification (CQN) callback from the data change invoke a python method. Or use Oracle Advanced Queues for the same. Examples are in https://github.com/oracle/python-cx_Oracle/tree/master/samples



      You could also use the DB's UTL_HTTP functionality to invoke a web service that runs python.






      share|improve this answer


























        0












        0








        0







        Another solution is to leave Python running, and let a Continuous Query Notification (CQN) callback from the data change invoke a python method. Or use Oracle Advanced Queues for the same. Examples are in https://github.com/oracle/python-cx_Oracle/tree/master/samples



        You could also use the DB's UTL_HTTP functionality to invoke a web service that runs python.






        share|improve this answer













        Another solution is to leave Python running, and let a Continuous Query Notification (CQN) callback from the data change invoke a python method. Or use Oracle Advanced Queues for the same. Examples are in https://github.com/oracle/python-cx_Oracle/tree/master/samples



        You could also use the DB's UTL_HTTP functionality to invoke a web service that runs python.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 13 '18 at 5:12









        Christopher JonesChristopher Jones

        1,8851615




        1,8851615






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53096146%2fhow-can-i-trigger-a-python-code-automatically%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            The Sandy Post

            Danny Elfman

            Pages that link to "Head v. Amoskeag Manufacturing Co."