Advertisement
here2share

# Tk_rip.py

Jan 28th, 2021
907
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. # Tk_rip.py -- 16 lines
  2.  
  3. from Tkinter import *
  4. import random
  5. height, width = 200, 600
  6. randomLines = []
  7. master = Tk()
  8. w = Canvas(master, width=width, height=height)
  9. w.pack()
  10.  
  11. for i in range(width+1):
  12.     rnd = random.randint(0, width)
  13.     randomLines.append(rnd)
  14. randomLines.sort()
  15. for i in range(width):
  16.     w.create_line(i, 0, i, (randomLines[i]+randomLines[i+1])*0.5+height/2-i)
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement