5n6r

Программа-поздравляка с "Днем всех влюбленных"!

Feb 13th, 2017
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.16 KB | None | 0 0
  1. +-------------------+
  2. | Посвящаю М. и Н.  |
  3. +-------------------+
  4.  
  5. # -*- coding: utf-8 -*-
  6. #!/usr/bin/env python3
  7. from tkinter import *
  8. from random import *
  9. import math
  10. def stars():
  11.     for i in range(0,800):
  12.         xx=randint(0,600)
  13.         yy=randint(0,400)
  14.         c.create_oval(xx,yy,xx+2,yy+2,fill=choice(["lightblue","blue","darkblue","lightyellow","yellow"]))
  15.         c.update()
  16. def plot_f():
  17.     for t in range(0,1000):
  18.         x=80*math.sin(t)-24*math.sin(3*t)
  19.         y=80*math.cos(t)+24*math.cos(2*t)-15*math.cos(3*t)-math.cos(4*t)
  20.         c.create_oval(x+300,y+130,x+301,y+151,outline="red")
  21.         c.create_oval(x+302,y+132,x+303,y+153,outline="darkred")
  22.         c.update()
  23. def txt():
  24.     c.create_text(300,300,text="С Днем Всех Влюбленных!",font="Verdana 25",fill="red")
  25.     c.create_text(301,301,text="С Днем Всех Влюбленных!",font="Verdana 25",fill="darkred")
  26. app=Tk()
  27. app.title(chr(9825)*3+" Cardioid версия 0.14.2 бета "+chr(169)+" 2017, программирование 5n6r "+chr(9825)*3)
  28. app.geometry("600x400")
  29. app.resizable(0,0)
  30. c=Canvas(app,width=599,heigh=399,bg="black",cursor = "heart")
  31. stars()
  32. plot_f()
  33. txt()
  34. c.pack()
  35. app.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment