Python Forum

Full Version: String variables in Tkinter
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I have string variable called park. I cannot see the value of the 'park' with following label in Tkinter:

lab=Label(mg,text=('Where: %.s'%(park))).place(x=10,y=30)
but I can see value of 'park' in the following way:

lab1_0=Label(mg,text=('Where:')).place(x=10,y=30)
lab1_1=Label(mg,text=((park))).place(x=45,y=45)
Any idea why the first one wouldn't display the 'park'?

Thanks.
make a string like:

my_variable= 'where's : s%'%(park)
lab=Label(mg,text=my_variable).place(x=10,y=30)
Thanks.