Python Forum
Printing Variable into the label
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Printing Variable into the label
#3
(Mar-18-2020, 02:18 AM)joe_momma Wrote: I'm missing some modules to run your script but from your code it looks like the
Quote:print(DATA)
is the information you want to create labels with.
If you could post a snip it of it you might get a better answer. I would make the data into a list or dictionary and use a for loop to create labels. When you use a StringVar() it's for only one label and that label text is changing. https://effbot.org/tkinterbook/variable.htm
What is your data type?
print(type(DATA))
Well actually I found a solution to do that. The solution is I create a new window in the function to do that so that I can use this variable into the label that I Create here is the code
def get_name():
    inputValue=Entry.get()
    ts=TimeSeries(key='-----------',output_format='pandas')
    root=tk.Toplevel()
    tk.Canvas()
    Label=tk.Label()
    photo = ImageTk.PhotoImage(Image.open("D:\\Profile\\Desktop\\Photos\\stockmrkt.jpg"))
    logo = tk.Label(root, image=photo)
    logo.pack()
    lower_frame=tk.Entry(root,bg="#80c1ff",bd=5)
    lower_frame.place(relx=0.5,rely=0.25,relwidth=0.75,relheight=0.6,anchor='n')
    label=tk.Label(lower_frame,text=DATA,font=('courier',10),anchor='nw',justify='left',bd=4)
    label.place(relwidth=1,relheight=1)
    tk.mainloop()
Reply


Messages In This Thread
Printing Variable into the label - by ardvci - Mar-14-2020, 08:14 PM
RE: Printing Variable into the label - by joe_momma - Mar-18-2020, 02:18 AM
RE: Printing Variable into the label - by ardvci - Mar-18-2020, 04:10 PM
RE: Printing Variable into the label - by joe_momma - Mar-18-2020, 11:06 PM
RE: Printing Variable into the label - by ardvci - Mar-19-2020, 04:31 PM
RE: Printing Variable into the label - by joe_momma - Mar-19-2020, 09:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  update text variable on label with keypress knoxvilles_joker 3 5,005 Apr-17-2021, 11:21 PM
Last Post: knoxvilles_joker
  [Tkinter] Trying to display a variable in a label Jordansonatina 2 17,947 Oct-31-2019, 06:28 PM
Last Post: Jordansonatina
  [Tkinter] HOW TO: Set [Label].config() by variable name reference? gazoxtapod 4 5,009 Apr-17-2019, 09:57 PM
Last Post: gazoxtapod
  [Tkinter] can't update label to include variable foxtreat 2 3,699 Dec-01-2018, 07:16 AM
Last Post: jfong
  printing option menu variable in label in Tkinter SmokerX 1 6,661 Jan-18-2018, 07:36 PM
Last Post: SmokerX

Forum Jump:

User Panel Messages

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