from tkinter import * """ Entry有一个get()方法,可以利用这个方法活得目前Entry的字符串内容。Widgt控件有一个常用方法Quit。执行此方法时 Python Shell窗口的程序将结束 ,但是此窗口应用程序继续运行 在设计GUI程序时,尝尝需要在建立Entry的文本框内默认建立输入文字,在Widgt的Entry控件中可以使用inser(index,s)方法插入字符串,其中s是所插入的字符串,字符串会插入 index的位置。设计程序时可以使用这个方法为文本框建立默认的文字,通常会将它放在ENtr方法建立完文本框后。 在tkinter中 可以使用delete(first,last=None)方法删除Entry内的第first到第last-1字符间的字符串,如果要删除字符串可以使用delete(0,END) """ def printInfo(): print("Account:%s \nPassword:%s"%(accountE.get(),pwdE.get())) accountE.delete(0,END) pwdE.delete(0,END) root=Tk() root.title("DearMysister") msg="欢迎进入Sillcon Stone Education系统" ssGif=PhotoImage(file="AA.png") logo=Label(root,image=ssGif,text=msg,compound=BOTTOM) accountL=Label(root,text="Account") accountL.grid(row=1,column=0) pwdL=Label(root,text="Password") pwdL.grid(row=2,column&
Tkinter中 Entry之 Get Insert delete eval的方法汇总
最新推荐文章于 2023-06-21 11:27:32 发布