不知到你的tkinter版本是啥?import Tkinter #首字母大写def hello(): print(i)top = Tkinter.Tk()for i in range(0, 4): Tkinter.Button(top, text=i, command=hello).grid(row=1, column=i)top.mainloop()我打印的是0,1,2,3.如果解决了您的问题请采纳!如果未解决请继续追问