Python Forum
[Tkinter] import numbers into a list and print (gui python)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] import numbers into a list and print (gui python)
#1
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
Reply
#2
Which graphics toolkit?  tk?  gtk?  qt?  wx?  Something else?
Reply
#3
(Aug-09-2017, 06:54 PM)nilamo Wrote: Which graphics toolkit?  tk?  gtk?  qt?  wx?  Something else?

graphics toolkit Tk
Reply
#4
What do you have so far?  What errors are you getting?
Reply
#5
(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']
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

example
Ab=[]
for i in range(3):
Ab.append(input('Give a num='))
print (Ab)
Reply
#6
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()
Reply


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 2,319 Sep-15-2020, 03:54 PM
Last Post: Pleiades

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020