在系统里,做这样的设置。 然后新建test.py,就会发现文件结尾有一个.txt 即test.py.txt 自己重命名,把test.py.txt,改成test.py 再去用python test.py尝试下。