我在Windows 7 32位系統中安裝了python 2.7.10。我創建了一個小腳本test.py並將其保存在文件夾D:\ python27中。現在,當我從windows cmd執行test.py
時,它運行良好。但是,當我在命令行中運行python,然後執行相同的命令test.py
我得到的錯誤:Windows 7 32位系統中的Python腳本執行錯誤
File "<stdin>",line 1, in<module>NameError:name 'test' is not defined.
我認爲這個答案符合你的問題,幫我一個忙,並將其標記爲解決方案。謝謝! –