在特定时间段后杀死任务[在其他任务被杀后]

时间:2017-08-06 03:48:06

标签: python

你好我是python中的初学者,我正在尝试执行一个代码,该代码会在其他任务被杀死的特定时间段后杀死任务。 我在搜索stackoverflow存档时发现了这些命令,但不知何故计时器不起作用(第一部分使用crome和potplayer的taskkill工作得很好,问题是在给定时间后关闭bitcomet)

Python版本:3.6.0

我用过的代码:

import os
import timer
os.system ("taskkill /f /im chrome.exe")
os.system ("taskkill /f /im PotPlayerMini64.exe")

def bitshut():
  os.system("taskkill /f /im BitComet.exe")
t = timer(3600.00, bitshut)
t.start()
#preferably i would like to shutdown bitcomet when the download has been 
finished

print("Your computer will shutdown now")

os.system ("shutdown /s /t 5")

0 个答案:

没有答案
相关问题