資源簡介
代碼片段和文件信息
#from?tkinter?import?TkLabelButtonEntryStringVarText
from?tkinter?import?*
import?pandas?as?pd
from?tkinter?import?filedialog
from?tkinter.messagebox?import?*
import?random
import?os
import?datetime
import?codecs
import?chardet
import?warnings
warnings.filterwarnings(“ignore“)
root=Tk()
e=StringVar()
e.set(1)#默認為1行
label=Label(roottext=‘請輸入表頭行數‘width=20height=10font=(‘宋體‘10‘bold‘))
label.place(relx=0.4rely=0anchor=NE)
entry=Entry(rootvalidate=‘key‘textvariable=e)
entry.place(relx=0.4rely=0.2anchor=NE)
text=Text(rootwidth=30height=20bg=‘white‘fg=‘blue‘)
text.place(relx=0.4rely=0.4anchor=N)
def?gettime():
????global?time1
????time1=““
????time2=datetime.datetime.now().strftime(u‘%Y-%m-%d\n?%H:%M:%S‘)
????Label(root?text=‘當前時間:‘bg=‘yellow‘font=10).place(relx=0.7rely=0.2)
????if?time2?!=?time1:
????????time1?=?time2
????????clock?=?Label(roottext=time1font=(‘宋體‘10‘bold‘)fg=“green“)
????????clock.configure(text=time2)
????????clo
- 上一篇:使用python 獲取知乎用戶粉絲
- 下一篇:Python實現的選擇排序算法
評論
共有 條評論