0
How to print txt ['text'] in canavs/tkinter
I want to print the text of txt=canvas.create_text (...,text='this is some text') I want the program to print 'this is some text ' I used print (txt['text']) it shows an error: int object is not subscriptable
2 ответов
0
This is irrelevant
- 1
Try this
import tkinter
main = tkinter.Tk()
label = tkinter.Label(main, text="some text")
main.mainloop()
label.pack()