내 코드는 다음과 같습니다.Python Tkinter 하나의 변수에 저장된 여러 항목 위젯에서 입력을받는 방법
from tkinter import *
def TakeInput():
print(tb.get()) #This will print Entry1 input
print(tb.get()) #This will print Entry2 input
tk=Tk()
#Entry 1
tb=Entry(tk) #Both Entry1 and Entry2 are stored in the same variable: tb
tb.pack()
#Entry 2
tb=Entry(tk) #Both Entry1 and Entry2 are stored in the same variable: tb
tb.pack()
#Button
b=Button(tk,text="PrintInput",command= TakeInput)
b.pack()
tk.mainloop()
내가하려고하는 일은 입력 변수 1과 입력 변수 2가 모두 같은 변수에 할당되어있을 때 표시하는 것입니다.
저는 파이썬 초보자입니다.
편집 코드가 도움이되지 않습니다. 내 대답을 편집하십시오. – TidB