mirror of
https://github.com/Xevion/tkinter-mini-projects.git
synced 2025-12-06 01:16:37 -06:00
init
This commit is contained in:
16
dynamic.py
Normal file
16
dynamic.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from tkinter import *
|
||||
from functools import partial
|
||||
import string
|
||||
|
||||
buttons = list(string.printable)
|
||||
print(buttons)
|
||||
root = Tk()
|
||||
|
||||
def txt(text):
|
||||
print(text)
|
||||
|
||||
for b in buttons:
|
||||
btn = Button(root, text=b, command=partial(txt, b))
|
||||
btn.pack(side=LEFT,pady=5)
|
||||
|
||||
root.mainloop()
|
||||
Reference in New Issue
Block a user