Python run system command and then exit… won't exit

前端 未结 4 867
悲&欢浪女
悲&欢浪女 2021-02-04 13:02

I have the following python code:

os.system(\"C:/Python27/python.exe C:/GUI/TestGUI.py\")
sys.exit(0)

It runs the command fine, and a window po

4条回答
  •  独厮守ぢ
    2021-02-04 13:42

    I suggest using os._exit instead of sys.exit, as sys.exit doesnt quit a program but raises exception level, or exits a thread. os._exit(-1) quits the entire program

提交回复
热议问题