Original article, without my permission to the system reproduced.
In my windows, python3.4 was installed first, and later because of the need to install python2.7, the results found:
Directly double-clicking on the 1.py and command-line python 1.py using the Python interpreter is different.
Directly double-click, using the later installation of the D:\Python27\python.exe
command line input python 1.py, using the previously installed D:\Program Files (x86) \python3.4\python.exe
However, my PATH environment variable contains only 3.4 paths, and I don't know why it's so weird, but pay attention to this distinction.
the way to avoid the pit : use absolute path.
How to judge the Python interpreter in a script:
1. Write a simple print to see if it can be executed.
2. Use the dedicated version interface:
Import Platform
Print (Platform.python_version ())
Original article, without my permission to the system reproduced.
Problems coexisting with multiple versions of Python in Windows