简体   繁体   中英

How to stop executing the python exe file created using pyinstaller (windows)

I have created an myprogram.exe file using the command

pyinstaller --onefile myprogram.py

I am trying to stop the execution of exe file using

import os
os.system("taskkill /im myprogram.exe")

But no luck. 1. Can any help me how can i stop the execution of exe file? 2. Also is it possible to find the already running python exe files?

Try forcing the command.

"TASKKILL /F /IM myprogram.exe"

NOTE: You can verify whether you exe is running or not by issuing "TASKLIST"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM