Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tk_rip.py -- 16 lines
- from Tkinter import *
- import random
- height, width = 200, 600
- randomLines = []
- master = Tk()
- w = Canvas(master, width=width, height=height)
- w.pack()
- for i in range(width+1):
- rnd = random.randint(0, width)
- randomLines.append(rnd)
- randomLines.sort()
- for i in range(width):
- w.create_line(i, 0, i, (randomLines[i]+randomLines[i+1])*0.5+height/2-i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement