coding cp1251 from Tkinter import from time import sleep def process c

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#-*- coding:cp1251 -*-
from Tkinter import *
from time import sleep
def process(colour):
x = 0
while x != 300:
c.create_line([(0, 0), (x, 300)], fill=colour)
sleep(0.001)
root.update()
x += 1
def process2():
x = 299
while x != -1:
c.create_line([(300, 300), (0, x)])
sleep(0.001)
root.update()
x -= 1
root = Tk()
frame = Frame(root)
frame.pack()
c = Canvas(frame, width=300, height=300, bg="black")
c.pack()
process('red')
process2()
process('green')
process2()
process('blue')
process2()
process('yellow')
process()
mainloop()