这里应用到模块
wxpython
pip install wxpython
下载使用前wxpython前请查看相应python版本是否支持
python最好是3.6版本
# coding=utf-8
import wx
from threading import Thread
from os import system
from time import sleep,localtime
#年列表
year=[str(i) for i in range(localtime().tm_year,localtime().tm_year+101)]
#月列表
month=[str(i) for i in range(1,13)]
#日列表
day=[str(i) for i in range(1,32)]
#小时列表
hour=[str(i) for i in range(0,24)]
#分钟列表
minute=[str(i) for i in range(0,60)]
class chuangkou(wx.Frame):#窗口的类
def __init__(self):
'''
参数
方法体
①start_button()#开始定时关机按钮绑定的函数
②shut_down()执行关机的函数
'''
self.g=Thread(target=self.shut_down)#创建循环判断是否关机的线程
self.g.start()#启动关机的线程
'''
添加成员区域
'''
super(chuangkou,self).__init__(None,-1,title='Windo