from Tkinter import *import tkMessageBoximport sysroot = Tk()root.geometry("500x700+50+50")root.title("Hello")ip_entry_var = StringVar() #给文bai本框du绑定值zhi要用daoStringVar类型exitbutton = Button(text = "退出", command = sys.exit).pack(side = "bottom")Entry(textvariable = ip_entry_var).pack()##给文本框绑定值ip_entry_varip_entry_var.set("input your ip here")def PrintCommand(): tkMessageBox.showinfo("Print",ip_entry_var.get()) ##StringVar -> String用get方法Button(text = "print", command =PrintCommand).pack()root.mainloop()www.179s.com防采集请勿采集本网。
问题出在oin = tk.IntVar()上 这个是随动的,你最后的oin值是20000,所以都变成20000,把oin = tk.IntVar()
oin.set(0)这两句移入for循环就可以了奖励园豆:5
按钮左键绑定方bai法showpic :button.bind('<Button-1>',self.showpic) 在showpic中使du用event.widget(这就zhi是该按钮)event.widget['text'] 获得该dao按钮的text然后进行判断就知道是版哪个按钮调权用的showpic()了~哈哈追问没看懂 能解释一下吗本回答被网友采纳,button7 = Button(root, text='total_detour', command=lambda: total_detours(s_df))内容来自www.179s.com请勿采集。
违法违规信息请立即联系本网可获得现金奖励,TEL:1-8-2-1-0-2-3-3-3-8-1(电话仅供违法违规信息举报,侵权类信息请EMAIL。)