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

  • 相关阅读:
    为什么 execute(`echo 中文`) 输出中文源码?
    使用图片跨域方式获取图片数据 使用 jsonp 方式跨域获取数据
    js 中的 sleep 方法, 阻塞式
    大数据存储单位介绍(TB、PB、EB、ZB、YB有多大)
    在 chrome 开发工具中使用终端
    作为一个代码搬运工,如何应对突如其来的灵魂拷问『你今天做了什么』?
    JVM相关
    python和C++联合调试
    Google protobuf解析消息逻辑的版本问题
    卷积转换为矩阵运算中填充数的计算-GEMM
  • 原文地址:https://www.cnblogs.com/djw12333/p/11268808.html
Copyright © 2011-2022 走看看