Reputation: 67
Pretty straightforward question, just wondering if there's any .format() way to remove squiggly brackets.
Here's my code:
from tkinter import *
root = Tk()
my_list = ['Air Conditioning']
Label_1 = Label(root, text=my_list)
Label_1.pack()
root.mainloop()
Current output is: {Air Conditioning}
Trying to get: Air Conditioning
Upvotes: 0
Views: 300
Reputation: 400
You're passing the list, instead try passing the first element in the list, like:
from tkinter import *
root = Tk()
my_list = ['Air Conditioning']
Label_1 = Label(root, text=my_list[0])
Label_1.pack()
root.mainloop()
Alternatively, remove the square brackets and just pass a string:
from tkinter import *
root = Tk()
my_string = 'Air Conditioning'
Label_1 = Label(root, text=my_string)
Label_1.pack()
root.mainloop()
Upvotes: 3