简体   繁体   中英

os.system('TASKKILL /F /IM EXCEL.exe') in python

I am using os.startfile(excel file) to open excel application. After running task kill , when I try to open excel again it gives me recovery options.

Is there any way to open the excel application and close it properly without giving recovery option when I open it again?

with the argument /F you force kill the program, not giving it time to save things or clear memory etc. what os.system('taskkill /T /IM EXCEL.exe) does is it sends the same singnal as the program gets when you press the close program button

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