This batch file will keep you from having to type the full absolute path for the Python program every time you want to run it. bat file extension (for example, pythonScript.bat). ![]() Replace this path with the absolute path to your own program, and save this file with a. To make a batch file, make a new text file containing a single line like the C:\path\to\your\pythonScript.py %* bat batch file for running the Python program with py.exe. To make it convenient to run your Python program, create a. Then use the py program to run your script:Ĭ:\folderwithyourscript>py -3 yourscript.py Use the cd command to change to the directory (that is, folder) that contains your Python script file. Use the -3 command line argument to make py.exe run the latest Python 3 version installed. The py.exe program will make sure to run the Python program with the correct version of Python if multiple versions are installed on your computer. py file’s source code and run the appropriate version of Python for that script. ![]() Alternatively, the convenient py.exe program will read the shebang line at the top of the. On Windows, the Python 3.4 interpreter is located at C:\Python34\python.exe.
0 Comments
Leave a Reply. |