我正在使用Tkinter创建一个简单的界面,但是当我使用insert函数时,我无法使框适应其中文本的大小
root = Tk()
sub_name = Entry(root)
num = Entry(root)
search_type = Entry(root)
flair_name = Entry(root)
comments = Entry(root)
sub_name.insert(0,"Enter the name of a subreddit")
num.insert(1,"enter how many posts you want to check for a specific flair")
search_type.insert(2,"Enter searech type (top - top posts of all time. hot - top posts in the last few days. new - the newest posts")
flair_name.insert(3,"Enter Flair type")
comments.insert(4,"Enter amount of comments you want to analysie per post")
sub_name.pack()
num.pack()
search_type.pack()
flair_name.pack()
comments.pack()
def myclick():
global sub_name
global num
global search_type
global flair_name
global comments
sub_name = sub_name.get()
num = num.get()
search_type = search_type.get()
flair_name = flair_name.get()
comments = comments.get()
root.destroy()
myButton = Button(root, text="Enter: ", command=myclick)
myButton.pack()
root.protocol(myclick)
root.geometry("500x500")
root.mainloop()
如有任何建议,将不胜感激
这对你有用吗
相关问题 更多 >
编程相关推荐