I have written a simple python script, and I need to run it as an executable, i.e., without the 'python' word at the beginning of the program. The script (simple_prog.py) is :
#!C:\Python27\python.exe
print "Hello World"
Whenever I am running the script as 'python simple_prog.py', it is printing the output alright, but without that, it is printing nothing (image below).
I have also referred to the "How do I make Python scripts executable?" section in the site https://docs.python.org/3/faq/windows.html#id3, from the stackoverflow question How to make python scripts executable on Windows? , but could not understand the solution.
Thanks.
Update :
Solved the problem from the stackoverflow link : Set up Python on Windows to not type python in cmd
This is what I followed (image below)
Please note the position of double-quotes in the ftype command.
The second command (simple_prog) ran successfully because I updated the PATHEXT variable by adding ".PY" in it.
Thanks for the responses as well as the downvotes.