Google搜索结果返回了一些有用的资源来解答您的问题。
Python文档
Python文档(http://docs.python.org/3.3/using/windows.html#python-launcher-for-
windows)提供了在同一台计算机上运行多个版本的快速概述。
第一种选择是使用以下内容将python版本包含在您希望执行的文件中:
#!python
您的代码在这里
要在Python 2中执行,或
#!python3
您的代码在这里
用于在Python 3版本中运行代码。然后,您只需使用“ python yourscript.py”,Python版本将由Python脚本指定。



