{"id":201732,"date":"2024-02-12T10:19:08","date_gmt":"2024-02-12T15:19:08","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=201732"},"modified":"2024-02-12T10:19:16","modified_gmt":"2024-02-12T15:19:16","slug":"running-python-from-the-task-scheduler","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/running-python-from-the-task-scheduler\/","title":{"rendered":"Running Python from the Task Scheduler"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\" id=\"h-background\"><strong>Background<\/strong><\/h3>\n\n\n\n<p>Running Python from the Windows Task Scheduler is a really useful capability. It allows you to run Python in production on a Windows system, and can save countless hours of work. For instance, running code like&nbsp;<a href=\"https:\/\/theautomatic.net\/2020\/03\/12\/reading-from-databases-with-python\/\">extracting data from a database<\/a>&nbsp;on an automated, regular basis is a common need at many companies.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-how-to-run-python-from-the-command-line\"><strong>How to run Python from the command line<\/strong><\/h3>\n\n\n\n<p>Before we go into how to schedule a Python script to run, you need to understand how to run Python from the command line. To open the command prompt (command line), press the windows key and type&nbsp;<strong>cmd<\/strong>&nbsp;into the search box.<\/p>\n\n\n\n<p>Next, suppose your python script is called&nbsp;<em>cool_python_script.py<\/em>, and is saved under&nbsp;<em>C:\\Users<\/em>. You can run this script from the command prompt by typing the below line:<\/p>\n\n\n\n<p><strong><em>python C:\\Users\\cool_python_script.py<\/em><\/strong><\/p>\n\n\n\n<p>If you get an error saying&nbsp;<strong><em>\u201c\u2018python\u2019 is not recognized as an internal or external command\u201d<\/em><\/strong>, then Python is probably not in your environment path. You can handle this in one of two main ways, but they both involve you figuring out where the Python executable is stored on your machine. You should be able to do this by searching for&nbsp;<strong><em>python.exe<\/em><\/strong>&nbsp;and opening the file location. Once the&nbsp;<strong><em>python.exe<\/em><\/strong>&nbsp;shows up in your search results, just right click and click \u201cOpen file location.\u201d<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"781\" height=\"642\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/python-open-file-location-the-automatic-net.png\" alt=\"\" class=\"wp-image-201734 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/python-open-file-location-the-automatic-net.png 781w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/python-open-file-location-the-automatic-net-700x575.png 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/python-open-file-location-the-automatic-net-300x247.png 300w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/python-open-file-location-the-automatic-net-768x631.png 768w\" data-sizes=\"(max-width: 781px) 100vw, 781px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 781px; aspect-ratio: 781\/642;\" \/><\/figure>\n\n\n\n<p>This should pull up the directory where&nbsp;<strong><em>python.exe<\/em><\/strong>&nbsp;is installed. Then you would use the full path (with this directory) to&nbsp;<strong><em>python.exe<\/em><\/strong>&nbsp;in your command prompt call. For example, if&nbsp;<strong><em>python.exe<\/em><\/strong>&nbsp;is stored at&nbsp;<em>C:\\Anaconda3<\/em>, you would type:<\/p>\n\n\n\n<p><strong><em>C:\\Anaconda3\\python.exe cool_python_script.py<\/em><\/strong><\/p>\n\n\n\n<p>The other solution is to add this location to your system PATH variable. For doing that, see&nbsp;<a href=\"https:\/\/www.howtogeek.com\/118594\/how-to-edit-your-system-path-for-easy-command-line-access\">this reference<\/a>. Then, you should be able to type the command from above without errors.<\/p>\n\n\n\n<p><strong><em>python C:\\Users\\cool_python_script.py<\/em><\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Running Python from the Task Scheduler<\/strong><\/h3>\n\n\n\n<p>Once you know your Python script works from the command prompt, you can create a task in the Windows Task Scheduler to make it run at specific times and dates. Pressing the windows key, followed by typing&nbsp;<strong>\u201ctask scheduler\u201d<\/strong>&nbsp;should bring the Task Scheduler up. Once it\u2019s open, click on&nbsp;<strong>\u201cAction\u201d<\/strong>, and then press&nbsp;<strong>\u201cCreate Task.\u201d<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"757\" height=\"476\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/task-scheduler-create-task-the-automatic-net.png\" alt=\"\" class=\"wp-image-201736 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/task-scheduler-create-task-the-automatic-net.png 757w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/task-scheduler-create-task-the-automatic-net-700x440.png 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/task-scheduler-create-task-the-automatic-net-300x189.png 300w\" data-sizes=\"(max-width: 757px) 100vw, 757px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 757px; aspect-ratio: 757\/476;\" \/><\/figure>\n\n\n\n<p>After this, you will see a place where you need to input the name of your task.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"769\" height=\"149\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/create-task-name-the-automatic-net.png\" alt=\"\" class=\"wp-image-201738 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/create-task-name-the-automatic-net.png 769w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/create-task-name-the-automatic-net-700x136.png 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/create-task-name-the-automatic-net-300x58.png 300w\" data-sizes=\"(max-width: 769px) 100vw, 769px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 769px; aspect-ratio: 769\/149;\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>How to run a Python script without being logged on<\/strong><\/h3>\n\n\n\n<p>You will also see where you can select&nbsp;<strong>\u201cRun whether user is logged on or not.\u201d<\/strong>&nbsp;If you need to run a Python script in production where you won\u2019t necessarily be logged on all the time, then you should select the&nbsp;<strong>\u201cwhether user is logged on or not\u201d<\/strong>&nbsp;option. As a note, however, you will need to have the appropriate permissions for this to work for you. This generally means you\u2019ll need to have&nbsp;<a href=\"https:\/\/www.smartftp.com\/en-us\/support\/kb\/2691\">batch job rights<\/a>. If you\u2019re an administrator on the machine you\u2019re creating the task, then this shouldn\u2019t be a problem.<\/p>\n\n\n\n<p>Select the&nbsp;<strong>\u201cRun only when user is logged on\u201d<\/strong>&nbsp;option if you\u2019re just running a task on a computer where you\u2019ll be logged on when you need it to run.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"754\" height=\"128\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/create-task-user-logged-on-or-not-the-automatic-net.png\" alt=\"\" class=\"wp-image-201739 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/create-task-user-logged-on-or-not-the-automatic-net.png 754w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/create-task-user-logged-on-or-not-the-automatic-net-700x119.png 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/create-task-user-logged-on-or-not-the-automatic-net-300x51.png 300w\" data-sizes=\"(max-width: 754px) 100vw, 754px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 754px; aspect-ratio: 754\/128;\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Triggering the script to run<\/strong><\/h3>\n\n\n\n<p>The next step is to select the&nbsp;<strong>\u201cTriggers\u201d<\/strong>&nbsp;tab.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"730\" height=\"294\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/trigger-script-the-automatic-net.png\" alt=\"\" class=\"wp-image-201740 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/trigger-script-the-automatic-net.png 730w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/trigger-script-the-automatic-net-700x282.png 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/trigger-script-the-automatic-net-300x121.png 300w\" data-sizes=\"(max-width: 730px) 100vw, 730px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 730px; aspect-ratio: 730\/294;\" \/><\/figure>\n\n\n\n<p>You should get a box that pops up where you can select what dates \/ times you need your Python script to run. After you\u2019ve made your selections, you can go to the&nbsp;<strong>\u201cActions\u201d<\/strong>&nbsp;tab, where you\u2019ll create a new action. Clicking&nbsp;<strong>\u201cNew\u201d<\/strong>&nbsp;brings up the box below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"764\" height=\"293\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/actions-tab-the-automatic-net.png\" alt=\"\" class=\"wp-image-201741 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/actions-tab-the-automatic-net.png 764w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/actions-tab-the-automatic-net-700x268.png 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/actions-tab-the-automatic-net-300x115.png 300w\" data-sizes=\"(max-width: 764px) 100vw, 764px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 764px; aspect-ratio: 764\/293;\" \/><\/figure>\n\n\n\n<p>Here, you\u2019ll input&nbsp;<strong>\u201cpython\u201d<\/strong>&nbsp;into the&nbsp;<strong>\u201cProgram\/Script\u201d<\/strong>&nbsp;box, and type in the name of your script into the&nbsp;<strong>\u201cAdd Arguments (optional)\u201d<\/strong>&nbsp;box.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"753\" height=\"346\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/python-script-the-automatic-net.png\" alt=\"\" class=\"wp-image-201743 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/python-script-the-automatic-net.png 753w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/python-script-the-automatic-net-700x322.png 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/01\/python-script-the-automatic-net-300x138.png 300w\" data-sizes=\"(max-width: 753px) 100vw, 753px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 753px; aspect-ratio: 753\/346;\" \/><\/figure>\n\n\n\n<p>After this, you should be all set! Just press&nbsp;<strong>\u201cOK\u201d<\/strong>, and you\u2019re done.<\/p>\n\n\n\n<p><em>Originally posted on <a href=\"https:\/\/theautomatic.net\/2017\/10\/03\/running-python-task-scheduler\/\">TheAutomatic.net<\/a> blog.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Before we go into how to schedule a Python script to run, you need to understand how to run Python from the command line.<\/p>\n","protected":false},"author":388,"featured_media":21196,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[339,343,349,338,341],"tags":[],"contributors-categories":[13695],"class_list":{"0":"post-201732","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data-science","8":"category-programing-languages","9":"category-python-development","10":"category-ibkr-quant-news","11":"category-quant-development","12":"contributors-categories-theautomatic-net"},"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Running Python from the Task Scheduler | IBKR Quant<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/201732\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Running Python from the Task Scheduler\" \/>\n<meta property=\"og:description\" content=\"Before we go into how to schedule a Python script to run, you need to understand how to run Python from the command line.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/running-python-from-the-task-scheduler\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-12T15:19:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-12T15:19:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2019\/10\/tech-touch-python.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1100\" \/>\n\t<meta property=\"og:image:height\" content=\"690\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Andrew Treadway\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andrew Treadway\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\n\t    \"@context\": \"https:\\\/\\\/schema.org\",\n\t    \"@graph\": [\n\t        {\n\t            \"@type\": \"NewsArticle\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/running-python-from-the-task-scheduler\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/running-python-from-the-task-scheduler\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Andrew Treadway\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/d4018570a16fb867f1c08412fc9c64bc\"\n\t            },\n\t            \"headline\": \"Running Python from the Task Scheduler\",\n\t            \"datePublished\": \"2024-02-12T15:19:08+00:00\",\n\t            \"dateModified\": \"2024-02-12T15:19:16+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/running-python-from-the-task-scheduler\\\/\"\n\t            },\n\t            \"wordCount\": 694,\n\t            \"commentCount\": 0,\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/running-python-from-the-task-scheduler\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2019\\\/10\\\/tech-touch-python.jpg\",\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Programming Languages\",\n\t                \"Python Development\",\n\t                \"Quant\",\n\t                \"Quant Development\"\n\t            ],\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"CommentAction\",\n\t                    \"name\": \"Comment\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/running-python-from-the-task-scheduler\\\/#respond\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/running-python-from-the-task-scheduler\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/running-python-from-the-task-scheduler\\\/\",\n\t            \"name\": \"Running Python from the Task Scheduler | IBKR Campus US\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\"\n\t            },\n\t            \"primaryImageOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/running-python-from-the-task-scheduler\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/running-python-from-the-task-scheduler\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2019\\\/10\\\/tech-touch-python.jpg\",\n\t            \"datePublished\": \"2024-02-12T15:19:08+00:00\",\n\t            \"dateModified\": \"2024-02-12T15:19:16+00:00\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"ReadAction\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/running-python-from-the-task-scheduler\\\/\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"ImageObject\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/running-python-from-the-task-scheduler\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2019\\\/10\\\/tech-touch-python.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2019\\\/10\\\/tech-touch-python.jpg\",\n\t            \"width\": 1100,\n\t            \"height\": 690,\n\t            \"caption\": \"Python Programming\"\n\t        },\n\t        {\n\t            \"@type\": \"WebSite\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"name\": \"IBKR Campus US\",\n\t            \"description\": \"Financial Education from Interactive Brokers\",\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"SearchAction\",\n\t                    \"target\": {\n\t                        \"@type\": \"EntryPoint\",\n\t                        \"urlTemplate\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/?s={search_term_string}\"\n\t                    },\n\t                    \"query-input\": {\n\t                        \"@type\": \"PropertyValueSpecification\",\n\t                        \"valueRequired\": true,\n\t                        \"valueName\": \"search_term_string\"\n\t                    }\n\t                }\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"Organization\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\",\n\t            \"name\": \"Interactive Brokers\",\n\t            \"alternateName\": \"IBKR\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"logo\": {\n\t                \"@type\": \"ImageObject\",\n\t                \"inLanguage\": \"en-US\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\",\n\t                \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"width\": 669,\n\t                \"height\": 669,\n\t                \"caption\": \"Interactive Brokers\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\"\n\t            },\n\t            \"publishingPrinciples\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/about-ibkr-campus\\\/\",\n\t            \"ethicsPolicy\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/cyber-security-notice\\\/\"\n\t        },\n\t        {\n\t            \"@type\": \"Person\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/d4018570a16fb867f1c08412fc9c64bc\",\n\t            \"name\": \"Andrew Treadway\",\n\t            \"description\": \"Andrew Treadway currently works as a Senior Data Scientist, and has experience doing analytics, software automation, and ETL. He completed a master\u2019s degree in computer science \\\/ machine learning, and an undergraduate degree in pure mathematics. Connect with him on LinkedIn: https:\\\/\\\/www.linkedin.com\\\/in\\\/andrew-treadway-a3b19b103\\\/In addition to TheAutomatic.net blog, he also teaches in-person courses on Python and R through my NYC meetup: more details.\",\n\t            \"sameAs\": [\n\t                \"https:\\\/\\\/theautomatic.net\\\/about-me\\\/\"\n\t            ],\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/andrewtreadway\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Running Python from the Task Scheduler | IBKR Quant","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/201732\/","og_locale":"en_US","og_type":"article","og_title":"Running Python from the Task Scheduler","og_description":"Before we go into how to schedule a Python script to run, you need to understand how to run Python from the command line.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/running-python-from-the-task-scheduler\/","og_site_name":"IBKR Campus US","article_published_time":"2024-02-12T15:19:08+00:00","article_modified_time":"2024-02-12T15:19:16+00:00","og_image":[{"width":1100,"height":690,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2019\/10\/tech-touch-python.jpg","type":"image\/jpeg"}],"author":"Andrew Treadway","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Andrew Treadway","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/running-python-from-the-task-scheduler\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/running-python-from-the-task-scheduler\/"},"author":{"name":"Andrew Treadway","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/d4018570a16fb867f1c08412fc9c64bc"},"headline":"Running Python from the Task Scheduler","datePublished":"2024-02-12T15:19:08+00:00","dateModified":"2024-02-12T15:19:16+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/running-python-from-the-task-scheduler\/"},"wordCount":694,"commentCount":0,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/running-python-from-the-task-scheduler\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2019\/10\/tech-touch-python.jpg","articleSection":["Data Science","Programming Languages","Python Development","Quant","Quant Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/running-python-from-the-task-scheduler\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/running-python-from-the-task-scheduler\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/running-python-from-the-task-scheduler\/","name":"Running Python from the Task Scheduler | IBKR Campus US","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/running-python-from-the-task-scheduler\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/running-python-from-the-task-scheduler\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2019\/10\/tech-touch-python.jpg","datePublished":"2024-02-12T15:19:08+00:00","dateModified":"2024-02-12T15:19:16+00:00","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/running-python-from-the-task-scheduler\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/running-python-from-the-task-scheduler\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2019\/10\/tech-touch-python.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2019\/10\/tech-touch-python.jpg","width":1100,"height":690,"caption":"Python Programming"},{"@type":"WebSite","@id":"https:\/\/ibkrcampus.com\/campus\/#website","url":"https:\/\/ibkrcampus.com\/campus\/","name":"IBKR Campus US","description":"Financial Education from Interactive Brokers","publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ibkrcampus.com\/campus\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ibkrcampus.com\/campus\/#organization","name":"Interactive Brokers","alternateName":"IBKR","url":"https:\/\/ibkrcampus.com\/campus\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","width":669,"height":669,"caption":"Interactive Brokers"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/"},"publishingPrinciples":"https:\/\/www.interactivebrokers.com\/campus\/about-ibkr-campus\/","ethicsPolicy":"https:\/\/www.interactivebrokers.com\/campus\/cyber-security-notice\/"},{"@type":"Person","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/d4018570a16fb867f1c08412fc9c64bc","name":"Andrew Treadway","description":"Andrew Treadway currently works as a Senior Data Scientist, and has experience doing analytics, software automation, and ETL. He completed a master\u2019s degree in computer science \/ machine learning, and an undergraduate degree in pure mathematics. Connect with him on LinkedIn: https:\/\/www.linkedin.com\/in\/andrew-treadway-a3b19b103\/In addition to TheAutomatic.net blog, he also teaches in-person courses on Python and R through my NYC meetup: more details.","sameAs":["https:\/\/theautomatic.net\/about-me\/"],"url":"https:\/\/www.interactivebrokers.com\/campus\/author\/andrewtreadway\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2019\/10\/tech-touch-python.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/201732","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/users\/388"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=201732"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/201732\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/21196"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=201732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=201732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=201732"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=201732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}