Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Add text into rectangle into Canvas?

$
0
0

How do I create text in a rectangle in Tkinter Canvas?
Because, all what I can do is create 2 separate objects.
I have tried doing this:

rect = canvas.create_rectangle(0,0,100,100,fill="orange")text = canvas.create_text(50,50,text="Hello, Python!")

But those were just 2 objects, which I couldn't move both of them using 1 line of code.
So, how do i it?


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>