Akash Nil
Akash Nil

Reputation: 703

remove {} from Tkinter label

import Tkinter
window=Tk()
msg1='abc'
msg2='def'
label =Label(window,text=(msg1,msg2), fg='blue')
label.grid(row=0,column=1)
window.mainloop()

output is {abc}{def} I want output as abcdef. how to do that?

Upvotes: 1

Views: 116

Answers (1)

Morb
Morb

Reputation: 534

You're writing text=(msg1,msg2) with (msg1,msg2) being a list. Just change it to msg1+msg2

And this code cannot work, you can't create a Tk() if you import Tkinter like that. Change it to from Tkinter import *

Upvotes: 3

Related Questions