Jan-03-2020, 04:43 AM
Your other option is to use functools module and partial
import tkinter as tk from functools import partial class Yahtzee(tk.Frame): def __init__(self, parent=None): .... def make_dice(self): for pic in picture_list: btn=tk.Button(parent, image= pic, command= partial(when_clicked,arguments) btn.pack(side=left) ...... def when_clicked(*args): ...pretty sure I gave you a class template on your last post, search saving your photo images so they won't get garbage collected, Start making lists, use loops, zip list into dictionaries. Lists are static they won't change position. refract and simplify.