How to close a cmd window using python 2.7

前端 未结 5 905
南方客
南方客 2021-01-15 06:03

The title pretty much says it, although it does not need to be specific to a cmd, just closing an application in general. I have seen

os.system(taskkill bla         


        
5条回答
  •  逝去的感伤
    2021-01-15 06:46

    something like this?

    import sys
    sys.exit()
    

    or easier ...

    raise SystemExit
    

    if that's not what your looking for tell me

    also you can just save the file with a .pyw and that doesn't open the cmd at all

提交回复
热议问题