Answers for "draw rectangle python tkinter"

4

rectangle in tkinter

from tkinter import *

root = Tk()

c = Canvas(root)
c.pack()
c.create_rectangle(100, 100, 200, 200)

root.mainloop()
Posted by: Guest on July-01-2020
3

tkinter draw squaer

canvas.create_rectangle(30, 10, 120, 80,
    outline="#fb0", fill="#fb0")
Posted by: Guest on February-19-2020
1

tkinter draw squaer

from Tkinter import *
master = Tk()

w = Canvas(master, width=250, height=200)
w.create_rectangle(0, 0, 100, 100, fill="blue", outline = 'blue')
w.create_rectangle(50, 50, 100, 100, fill="red", outline = 'blue') 
w.pack()
master.mainloop()
Posted by: Guest on February-20-2020
1

python how to draw a rectangle

import turtle
for i in range(2):
  turtle.forward(20)
  turtle.right(90)
  turtle.forward(10)
Posted by: Guest on December-31-2020

Python Answers by Framework

Browse Popular Code Answers by Language