我是TKinter的新手,我不知道如何在TKinter中存储来自文本框的输入。我试着遵循几乎每一个教程,看了类似的帖子,但他们的想法并没有解决我的问题:/。
def cityInfoWindow(self, flightMap):
infoWindow = Tk()
infoWindow.geometry("500x500+100+100")
infoWindow.title("CSAir-City Information")
global input
input = StringVar()
cityEntry = Entry(infoWindow,textvariable = input).pack()
okButton = Button(infoWindow, text = 'Submit', command = lambda:self.getCityInfo(infoWindow, input)).pack()
def getCityInfo(self, infoWindow, input):
content = input.get()
print content
return
我试着把我的输入传递到我的函数中,但那不起作用。
目前没有回答
相关问题 更多 >
编程相关推荐