Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tk_heart.py
- from Tkinter import *
- from math import *
- import time
- class Cv(): 0
- cv = Cv()
- root = Tk()
- root.title('Got A Love For Programming')
- canvas = Canvas(root, width=600, height=600, bg='white') # 0,0 is top left corner
- canvas.pack(expand=YES, fill=BOTH)
- x2 = 0
- xx,yy = 300,500
- for i in range(63):
- x1 = 0.25 * (-pow(i,2) + 43*i + 1200)*sin((pi*i)/180)
- y1 = -0.25 * (-pow(i,2) + 43*i + 1200)*cos((pi*i)/180) + yy
- if not x2:
- x2 = x1
- y2 = y1
- canvas.create_line(x1+xx-12,y1,x2+xx-12,y2, fill='red', width=5)
- canvas.create_line(-x1+xx,y1,-x2+xx,y2, fill='red', width=5)
- x2 = x1
- y2 = y1
- canvas.update()
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement