Advertisement
here2share

# GrowingCircle.py

Feb 20th, 2020
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. # GrowingCircle.py
  2.  
  3. from Tkinter import *
  4.  
  5. w=640
  6. h=640
  7. root = Tk()
  8. canvas = Canvas(root, width=w, height=h, bg="black")
  9. canvas.grid()
  10. root.wm_title("Growing Circle")
  11.  
  12. def _create_circle(self, x, y, r, **kwargs):
  13.     return self.create_oval(x-r, y-r, x+r, y+r, **kwargs)
  14. Canvas.create_circle = _create_circle
  15.  
  16. while 1:
  17.     for z in range(5,320):
  18.         canvas.create_circle(w/2, h/2, z, fill="black", outline="white", width=2)
  19.         canvas.update()
  20.         canvas.create_circle(w/2, h/2, z, fill="black", outline="black", width=2)
  21.    
  22. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement