在python中可以使用下面的语句关闭指定程序:
os.system("taskkill /F /IM 进程名")
示例:
import os #关闭指定程序 os.system("taskkill /F /IM QQ.exe")
运行以上程序会关闭qq并输出0。