Using python 2.7.11 on Windows 10 64-bit Home Premium upgraded in place from Windows 7
In a standard console, the following code is saved as hello.py and prints:
Hello World
When invoked with
python hello.py
#! python
print 'Hello World'
It produces no console output at all when invoked with
hello.py
or hello
The program runs in all three cases.
I can demonstrate this by adding
with open('world.txt', 'w') as fh:
fh.write('dolly\n')
Each of the three methods of invoking the program all successfully write world.txt with the correct information.
python.exe is in my path
.py is in the pathext variable
.py is associated with python.exe, and the correct command line is in the "shell open" registry entry.
all of the above is in accordance with
https://docs.python.org/2/faq/windows.html
I had no trouble running python scripts from the command line without the extension in Windows 7
Thanks,