Im making a list of addresses that the user will select from, and the address text will be returned. I need to use Tkinter.Label
because the Tkinter.List
label = Label(text = 'Hello, World!')
print(label['text']) # output is: Hello, World!
To get the value out of a label you can use the cget method, which can be used to get the value of any of the configuration options.
For example:
l = tk.Label(text="hello, world")
...
print("the label is", l.cget("text"))
You can also treat the object as a dictionary, using the options as keys. Using the same example you can use l["text"]
.