Possible Duplicate:
Set up Python on Windows to not type python in cmd
When I use python on Linux, or even Mac OS from command line, I take advantage of the shebang and run some of my scripts directly, like so: ./myScript.py
. I do need to give this script executable permissions, but that is all.
Now, I just installed Python 3.1.2 on Windows 7, and I want to be able to do the same from command line. What additional steps do I need to follow?
You can run multiple instances of a python script from a shell however from within a python program without the use of multithreading/multiprocessing the GIL limitation will impact what you are trying to do.
Using pyinstaller you can convert the python file to exe. Type pyinstaller <python-file-name>, this will convert the . py to .exe file with console. Add –no-console keyword after pyinstaller to convert python file to executable without command prompt.
This sums it up better than I can say it:
http://docs.python.org/faq/windows.html
More specifically, check out the 2nd section titled "How do I make Python scripts executable?"
On Windows, the standard Python installer already associates the
.py
extension with a file type (Python.File
) and gives that file type an open command that runs the interpreter (D:\Program Files\Python\python.exe "%1" %*
). This is enough to make scripts executable from the command prompt asfoo.py
. If you’d rather be able to execute the script by simple typingfoo
with no extension you need to add.py
to thePATHEXT
environment variable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With