Advertisement
here2share

# Tk_Incrementing_Lines.py

Dec 2nd, 2020
1,329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. # Tk_Incrementing_Lines.py
  2.  
  3. # just wondering what this would look like
  4.  
  5. from Tkinter import *
  6.  
  7. ww = 120
  8. hh = 120
  9. root = Tk()
  10. root.title("Incrementing Lines")
  11. root.geometry("%dx%d+0+0"%(ww,hh))
  12. canvas = Canvas(root, width=ww, height=hh)
  13. canvas.grid()
  14.  
  15. lines = [ww]*ww
  16. incr = [0 if not z else 2.0/z for z in range(ww)]
  17.  
  18. while 1:
  19.     canvas.delete('all')
  20.     for y in range(hh):
  21.         lines[y] = (lines[y]+incr[y])%(ww*2)
  22.         x = abs(ww-lines[y])
  23.         canvas.create_line(-2,y,x,y)
  24.     root.update()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement