如何在程序的其余部分使用输入Tkinter entry小部件的内容? 我有这个条目:
n = StringVar()
Entry(search1, textvariable=n).pack()
label = n.get()
with open('data.txt') as json_file:
data = json.load(json_file)
for p in data:
recipe = p['recipe']
recipeNames= recipe['label']
if recipeNames == label:
recipeName = label
ingredients = []
for j in recipe['ingredients']:
ingredients.append(j['text'])
Button(search1, text="Enter", command=partial(addrecipe, recipeName, calendarID, ingredients, service)).pack()
当我尝试使用变量时,它没有任何内容,并且返回时出错。如何将变量分配给条目小部件中的内容
目前没有回答
相关问题 更多 >
编程相关推荐