Aug-09-2017, 08:21 PM
I'm not sure what importing a list of numbers means, but here's a simple example of how to have a click handler attached to a button:
import tkinter as tk class Items: def __init__(self, data): self.data = data def click(self): print(self.data) root = tk.Tk() things = Items(["spam", "eggs"]) button = tk.Button(root, text="Print the things", command=things.click) button.pack() root.mainloop()