#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
评论
共有 条评论