Advertisement
someone3709

200x200 blue square

Feb 11th, 2023
1,061
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. from tkinter import *
  2.  
  3. # Create the window
  4. window = Tk()
  5.  
  6. # Create the canvas
  7. canvas = Canvas(window, width=200, height=200, bg='white')
  8.  
  9. # Create the square
  10. square = canvas.create_rectangle(0, 0, 200, 200, fill='blue')
  11.  
  12. # Pack the canvas
  13. canvas.pack()
  14.  
  15. # Run the Tkinter event loop
  16. window.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement