Aug-09-2017, 06:35 PM
How do I import numbers into a list in Python's graphic environment (gui of python) and how to print them through a button
Thanks in advance
Thanks in advance
[Tkinter] import numbers into a list and print (gui python)
|
Aug-09-2017, 06:35 PM
How do I import numbers into a list in Python's graphic environment (gui of python) and how to print them through a button
Thanks in advance
Aug-09-2017, 06:54 PM
Which graphics toolkit? tk? gtk? qt? wx? Something else?
Aug-09-2017, 07:05 PM
Aug-09-2017, 07:16 PM
What do you have so far? What errors are you getting?
Aug-09-2017, 07:48 PM
(This post was last modified: Aug-09-2017, 07:53 PM by kostasalgo.)
(Aug-09-2017, 07:16 PM)nilamo Wrote: What do you have so far? What errors are you getting? I do not have any errors in code I ask for an basic example to create it at the beginning (Aug-09-2017, 07:48 PM)kostasalgo Wrote: [quote='nilamo' pid='22586' dateline='1502306181'] I do not have any errors in code I ask for an basic example to create it at the beginning example Ab=[] for i in range(3): Ab.append(input('Give a num=')) print (Ab)
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() |
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
[Tkinter] How to Print a list = ['a','b','c'], using tkinter along with a custom font? | Pleiades | 2 | 3,402 |
Sep-15-2020, 03:54 PM Last Post: Pleiades |