-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathString Art.py
More file actions
59 lines (40 loc) · 1.57 KB
/
String Art.py
File metadata and controls
59 lines (40 loc) · 1.57 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Now let's create a tkinter digital string-art design using a
# for-loop. Type and execute/run the tkinter program example
# below and see what happens.
from tkinter import*
root=Tk()
draw=Canvas(root,height=500,width=500,bg='black')
for i in range(0,400,3):
draw.create_line(50+i,50+i,450,50,450,50,450,450,50,450,50+i,50+i,fill='cyan')
draw.pack()
root.mainloop()
# Now let's create a tkinter digital string-art design using a tkinter
# 'rectangle' command with a for-loop. Type and execute/run the
# tkinter program example below and see what happens.
from tkinter import*
root=Tk()
draw=Canvas(root,height=500,width=500,bg='black')
for i in range(0,96,5):
draw.create_rectangle(150+i,100+i,340-i,400-i,outline='cyan')
draw.pack()
root.mainloop()
# Now let's create a tkinter digital string-art design using a tkinter
# 'oval' command with a for-loop. Type and execute/run the tkinter
# program example below and see what happens.
from tkinter import*
root=Tk()
draw=Canvas(root,height=500,width=500,bg='black')
for i in range(0,96,5):
draw.create_oval(150+i,100+i,340-i,400-i,outline='cyan')
draw.pack()
root.mainloop()
# Now let's create a tkinter digital string-art design using a tkinter
# 'arc' command with a for-loop. Type and execute/run the tkinter
# program example below and see what happens.
from tkinter import*
root=Tk()
draw=Canvas(root,height=500,width=500,bg='black')
for i in range(0,140,5):
draw.create_arc(120+i ,120+i,400-i,400-i,extent=180,outline='cyan')
draw.pack()
root.mainloop()