基本库
1. 计划任务
import schedule
import time
def job():
print("hello world")
schedule.every(10).seconds.do(job)
schedule.every(10).minutes.do(job)
schedule.every().hour.do(job)
schedule.every().day.at("10:30").do(job)
schedule.every(5).to(10).minutes.do(job)
schedule.every().monday.do(job)
schedule.every().wednesday.at("13:15").do(job)
schedule.every().minute.at(":17").do(job)
while True:
schedule.run_pending()
time.sleep(1)
其他实现:
windows , 任务计划程序; java cron ; oracle-db schedule-job
2. tkinter GUI
import tkinter as tk
root=tk.Tk()
c=tk.Canvas(root,width=800,height=600,bg='#afeeee')
c.create_text(100,20,fill='darkblue',text="hello world")
c.pack()
root.mainloop()
# tkinter.py
# tkinter.commondialog.Dialog<=messagebox.py --->class Message.showinfo
- mac anaconda
pip 配置
cd ~
mkdir .pip
vi .pip/pip.conf
[global]
trusted-host=mirrors.aliyun.com
index-url=https://mirrors.aliyun.com/pypi/simple/