zoukankan      html  css  js  c++  java
  • python 系统定时关机

      #coding=utf-8

      "shutdown at 23:00"

      from datetime import *

      import os

      import win32api

      import win32con

      from threading import *

      tmNow = datetime.now()

      d = date.today()

      t = time(23,10,0)

      shtdownTime = datetime.combine(d,t)

      def ShowHint():

      while True:

      tmNow = datetime.now()

      timedDelta = (shtdownTime - tmNow).total_seconds()

      if timedDelta < 60:

      win32api.MessageBox(win32con.NULL, u'还有59s关机,赶快保存一下!', u'温馨提醒', win32con.MB_OK)

      break

      else:

      continue

      def ShutDown():

      while True:

      tmNow = datetime.now()

      timedDelta = (shtdownTime - tmNow).total_seconds()

      if timedDelta < 60:

      os.system('shutdown -s -f -t 59')

      break

      else:

      continue

      if __name__ == '__main__':

      threadShowHint = threading.Thread(target=ShowHint)

      threadShutDown = threading.Thread(target=ShutDown)

      threadShowHint.start()

      threadShutDown.start()

      #coding=utf-8

      "shutdown at 23:00"

      from datetime import *

      import os

      import win32api

      import win32con

      from threading import *

      tmNow = datetime.now()

      d = date.today()

      t = time(23,10,0)

      shtdownTime = datetime.combine(d,t)

      def ShowHint():

      while True:

      tmNow = datetime.now()

      timedDelta = (shtdownTime - tmNow).total_seconds()

      if timedDelta < 60:

      win32api.MessageBox(win32con.NULL, u'还有59s关机,赶快保存一下!', u'温馨提醒', win32con.MB_OK)

      break

      else:

      continue

      def ShutDown():

      while True:

      tmNow = datetime.now()

      timedDelta = (shtdownTime - tmNow).total_seconds()

      if timedDelta < 60:

      os.system('shutdown -s -f -t 59')

      break

      else:无锡人流手术多少钱 http://www.chnk120.com/

      continue

      if __name__ == '__main__':

      threadShowHint = threading.Thread(target=ShowHint)

      threadShutDown = threading.Thread(target=ShutDown)

      threadShowHint.start()

      threadShutDown.start()

      from datetime import *

      import os

      tmNow = datetime.now()

      d = date.today()

      t = time(23,10,0)

      shtdownTime = datetime.combine(d,t)

      def ShutDown():

      while True:

      tmNow = datetime.now()

      timedDelta = (shtdownTime - tmNow).total_seconds()

      if timedDelta < 60:

      os.system('shutdown -s -f -t 59')

      break

      else:

      continue

      if __name__ == '__main__':

      ShutDown()

  • 相关阅读:
    基于git的源代码管理模型——git flow
    [Android]在Adapter的getView方法中绑定OnClickListener比较好的方法
    Java后台测试技巧
    JIRA python篇之展示多人未完成任务列表
    基于python3在nose测试框架的基础上添加测试数据驱动工具
    Java操作memcache
    对于软件测试行业的观察与反思
    通过Fiddler肆意修改接口返回数据进行测试
    Python操作MySQL数据库
    如何通过Fiddler模拟弱网进行测试
  • 原文地址:https://www.cnblogs.com/djw12333/p/11268808.html
Copyright © 2011-2022 走看看