我想制作一个程序,向我显示使用 python tkinter GUI 在文本框中引入的数字的除数,并将结果存储到纯文本文件中。
我不知道如何从文本框中获取值。我知道这是与 相关的东西get(),我读了一些东西,但我仍然不明白。
这是代码:
from tkinter import *
def create_file():
file_object = open("C:/Users/valis/Desktop/Divisors.txt","w+")
def evaluate():
show_after= Label(text= "Check your Desktop !")
show_after.pack(pady=2, anchor=SW)
create_file()
#Windows size and Title
window = Tk()
window.title("Show Divisors")
window.geometry("300x100")
message = Label(window, text="Enter a number : ")
message.pack(pady=2, anchor=NW)
textbox_input = Text(window,height=1, width=11)
textbox_input.pack(padx= 2,pady= 2, anchor=NW)
window.mainloop()
代码不完整,我该怎么办?
茅侃侃
相关分类