pythonw.exe or python.exe?

前端 未结 6 1460
旧时难觅i
旧时难觅i 2020-11-22 08:36

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

test.py:

print \"a\"
         


        
6条回答
  •  情歌与酒
    2020-11-22 09:04

    If you're going to call a python script from some other process (say, from the command line), use pythonw.exe. Otherwise, your user will continuously see a cmd window launching the python process. It'll still run your script just the same, but it won't intrude on the user experience.

    An example might be sending an email; python.exe will pop up a CLI window, send the email, then close the window. It'll appear as a quick flash, and can be considered somewhat annoying. pythonw.exe avoids this, but still sends the email.

提交回复
热议问题