首先断开设备断开时无法获取警报框

时间:2016-12-07 05:25:27

标签: python

检查此代码 首先断开设备时,我无法收到警告框。

>if __name__ == '__main__':
old_count = new_count = seek()

startCounter = gracePeriod

有没有新的主机?

while (1):
    while (new_count <= old_count) or startCounter >= 0:
    startCounter -= 1
    time.sleep(1)               # increase to slow down the speed
    old_count = new_count
    new_count = seek()
pymsgbox.alert(" 'Host : %s (%s)' % (host, nm[host].hostname())", 'security alert!')
old_count = new_count =seek()
while (old_count <= new_count) or startCounter >= 0:
    startCounter -=1
    time.sleep(1)
    old_count = new_count
    new_count =seek()
pymsgbox.alert('A Device disconnected from the network',security alert')
old_count = new_count =seek()
beep()

0 个答案:

没有答案