• 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()

  • 相关阅读:
    浅出Java Socket 编程
    WPF指南之一(WPF的结构)
    使用URL访问网络资源
    WPF指南之三(XAML的名字空间)
    多线程并发思考文件加锁
    关于kindeditor上传图片出现"服务器发生故障"的解决办法
    isset function of PHP
    JSON字符串传到后台PHP处理的问题
    isset function of PHP
    (转)Linux利器 strace
  • 原文地址:https://www.cnblogs.com/djw12333/p/11268808.html
Copyright © 2020-2023  润新知