{"id":4333,"date":"2023-01-31T13:03:50","date_gmt":"2023-01-31T13:03:50","guid":{"rendered":"https:\/\/ibex.tech\/python\/?p=4333"},"modified":"2025-05-16T13:28:03","modified_gmt":"2025-05-16T12:28:03","slug":"running-python-scripts-programs","status":"publish","type":"post","link":"https:\/\/ibex.tech\/python\/python-on-windows\/running-python-scripts-programs","title":{"rendered":"Running Python scripts &#038; programs"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Using the Windows command prompt<\/h4>\n\n\n\n<p>This is the format of what you need to enter<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\&gt; python the_python_script_i_want_to_run any_arguments<\/code><\/pre>\n\n\n<p>python<\/p>\n<p style=\"padding-left: 40px;\">Instructs that you want to use python.exe for this.&nbsp; Sometimes you need to enter &#8220;python3&#8221; instead of &#8220;python&#8221;, if that&#8217;s what your .exe is named.<\/p>\n<p style=\"padding-left: 40px;\">This assumes you have the path to python.exe added to your Windows PATH environmental variable. If not you need to either add it (and reboot your PC), or instead provide the full path to your python install. e.g.&nbsp;<br \/>C:\\Espressif\\.espressif\\python_env\\idf5.0_py3.8_env\\Scripts\\python<br \/>or you&#8217;ll need to put quotes around the path if there&#8217;s spaces in it:<br \/>&#8220;C:\\Espressif\\.espressif\\python_env\\idf5.0_py3.8_env\\Scripts\\python.exe&#8221;<\/p>\n<p>the_python_script_i_want_to_run<\/p>\n<p style=\"padding-left: 40px;\">What you want python.exe to run for you. Again if you want to use just its name, you&#8217;ll need to ensure its path has been added to the Windows PATH environmental variable. Otherwise provide the full path to it, again with double quotes around it if there are spaces in the path.<\/p>\n<p>any_arguments<\/p>\n<p style=\"padding-left: 40px;\">If the python thing you are running has arguments that need to be provided, they get added here<\/p>\n\n\n<h5 class=\"wp-block-heading\">An example assuming your Windows PATH environmental variable has nothing added for Python<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\&gt; C:\\Espressif\\.espressif\\python_env\\idf5.0_py3.8_env\\Scripts\\python C:\/Espressif\/esp\/esp-idf\/components\/esptool_py\/esptool\/espefuse.py -p COM10 summary<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">An example assuming your Windows PATH environmental variable has the path to python.exe<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\&gt; python C:\/Espressif\/esp\/esp-idf\/components\/esptool_py\/esptool\/espefuse.py -p COM10 summary<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Running without using the command line<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">Running .py file directly<\/h5>\n\n\n\n<p>If python is properly installed in Windows you should be able to right click a .py file and select: Open with > Python<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Creating a shortcut to run a .py file<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>\"C:\\Path\\To\\Python.exe\" \"C:\\Path\\To\\YourScript.py\"<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Using the Windows command prompt This is the format of what you need to enter python Instructs that you want to use python.exe for this.&nbsp; Sometimes you need to enter &#8220;python3&#8221; instead of &#8220;python&#8221;, if that&#8217;s what your .exe is named. This assumes you have the path to python.exe added to your Windows PATH environmental [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[341],"tags":[],"class_list":["post-4333","post","type-post","status-publish","format-standard","hentry","category-python-on-windows"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts\/4333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/comments?post=4333"}],"version-history":[{"count":5,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts\/4333\/revisions"}],"predecessor-version":[{"id":4939,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts\/4333\/revisions\/4939"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/media?parent=4333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/categories?post=4333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/tags?post=4333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}