-
Notifications
You must be signed in to change notification settings - Fork 0
/
program_b.py
38 lines (24 loc) · 884 Bytes
/
program_b.py
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
import turtle
import imagesize
screen_width, screen_height = 1000, 800
altered_images = open('outputs.txt', 'r')
images = altered_images.readlines()[-4:]
screen = turtle.Screen()
screen.setup(screen_width, screen_height)
screen.bgcolor('white')
position_width = screen_width // 2
position_height = screen_height // -2
for line in images:
image = line.replace("\n", "")
image_width, image_height = imagesize.get(image)
screen.addshape(image)
print(position_width - image_width // 2,position_height + image_height // 2)
shape = turtle.Turtle()
shape.shape(image)
shape.penup()
shape.setpos(position_width - image_width // 2 , position_height + image_height // 2)
position_width -= image_width
if position_width < 0 :
position_height += image_height
position_width = screen_width // 2
shape.pendown()