我第一次在朋友的电脑(Windows7-x64)上安装Python时遇到这个错误
上面写着
C:UsersUsernameDesktopproyect> myproyect.py
File "myproyect.py" line 1
ActivePython 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)] on win32
▲
SyntaxError: invalid syntax
该文件包含的不仅仅是python代码,因此存在语法错误。
请检查文件是否只包含
print "hello world"
而不是
ActivePython 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)] on win32
# some other stuff...
print "hello world"