pythonw.exe 还是 python.exe? [英] pythonw.exe or python.exe?

查看:63
本文介绍了pythonw.exe 还是 python.exe?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

长话短说:pythonw.exe 什么都不做,python.exe 什么都不接受(我应该使用哪个?)

Long story short: pythonw.exe does nothing, python.exe accepts nothing (which one should I use?)

test.py:

print "a"

CMD 窗口:

C:\path>pythonw.exe test.py
<BLANK LINE>
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.

推荐答案

如果你不希望在运行程序时弹出终端窗口,使用pythonw.exe;
否则,使用 python.exe

If you don't want a terminal window to pop up when you run your program, use pythonw.exe;
Otherwise, use python.exe

关于语法错误:print 现在是一个函数在 3.x 中
所以改用:

Regarding the syntax error: print is now a function in 3.x
So use instead:

print("a")

这篇关于pythonw.exe 还是 python.exe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆