pythonw.exe or python.exe?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Long story short: pythonw.exe does nothing, python.exe accepts nothing (which one should I use?) test.py: print "a" CMD window: C:\path>pythonw.exe test.py C:\path> C:\path>python.exe test.py File "C:\path\test.py", line 7 print "a" ^ SyntaxError: invalid syntax C:\path> Please tell me what I'm doing terrible wrong. 回答1: If you don't want a terminal window to pop up when you run your program use pythonw.exe ; Otherwise, use python.exe Regarding the syntax error: print is now a function in 3.x So use instead: print("a") 回答2: To summarize and