def shutdown(self,sec,save=True,filepath='temp.h5'):
#Function used to shut down the computer
#sec:waitting time to shut down the computer,sencond
#save:wether saving the model
#filepath:the filepath for saving the model
#????
#sec:??????
#save:??????
#filepath:????????
if save:
self.model.save(filepath, overwrite=True)
self.t_send('Command accepted,the model has already been saved,shutting down the computer....', toUserName='filehelper')
else:
self.t_send('Command accepted,shutting down the computer....', toUserName='filehelper')
if 'Windows' in platform.system():
th.start_new_thread(system, ('shutdown -s -t %d' %sec,))
else:
m=(int(sec/60) if int(sec/60) else 1)
th.start_new_thread(system, ('shutdown -h -t %d' %m,))
#==============================================================================
#
#==============================================================================
wechat_utils.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录