.pyw and pythonw does not run under Windows 7

后端 未结 7 1390
猫巷女王i
猫巷女王i 2020-12-13 19:46

Running a simple .py or .pyw python file causes python.exe to show up under Task Manager.

python myApp.py
python myApp.pyw

How

相关标签:
7条回答
  • 2020-12-13 20:20

    I was having similar problem.

    After debugging step by step by writing to a log file, I discovered that pythonw.exe crashed after a statement that tried to use the call: sys.stdout.write(). It turns out, when run with pythonw.exe, sys.stdout is None.

    If you are using functions of sys.stdout/stderr/stdin, and intend to use your program with pythonw.exe, adding a check for "None" is a good idea.

    0 讨论(0)
提交回复
热议问题