Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- class Gui(object):
- def __init__(self):
- self.build_gui()
- def build_gui(self):
- lis = ['one', 'two', 'three']
- root = Tk()
- root.title('test')
- root.geometry('200x400')
- for i in lis:
- button = Button(root, text=i, command=lambda: self.delete(i))
- button.pack()
- root.mainloop()
- def delete(self, i):
- print(i)
- app = Gui()
Add Comment
Please, Sign In to add comment