- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path520.py
More file actions
Latest commit
100 lines (94 loc) · 3.62 KB
/
Copy path520.py
File metadata and controls
100 lines (94 loc) · 3.62 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
__author__ = 'thinkalonely'
__mtime__ = '2018/5/21'
# code is far away from bugs with the god animal protecting
I love animals. They taste delicious.
┏┓ ┏┓
┏┛┻━━━┛┻┓
┃ ☃ ┃
┃ ┳┛ ┗┳ ┃
┃ ┻ ┃
┗━┓ ┏━┛
┃ ┗━━━┓
┃ 神兽保佑 ┣┓
┃ 永无BUG! ┏┛
┗┓┓┏━┳┓┏┛
┃┫┫ ┃┫┫
┗┻┛ ┗┻┛
"""
fromPILimportImage
importrandom
mw=100
ms=20
toImage=Image.new('RGB', (2000, 2000))
names= []
withopen("C:/Users/hoo/desktop/pic.txt", "r") asf:
forlineinf:
line=line.strip()
names.append(line)
foryinrange(1, 21):
ifyin [1, 7]:
forxinrange(1, 21):
try:
fromImage=Image.open("C:/Users/hoo/Pictures/%s"%random.sample(names, 1)[0])
fromImage=fromImage.resize((100, 100), Image.ANTIALIAS)
ifxinlist(range(2, 7)) orxinlist(range(9, 14)) orxinlist(range(16, 20)):
toImage.paste(fromImage, ((x-1) *mw, y*mw))
exceptIOError:
pass
elifyin [2, 3]:
forxinrange(1, 21):
try:
fromImage=Image.open("C:/Users/hoo/Pictures/%s"%random.sample(names, 1)[0])
fromImage=fromImage.resize((100, 100), Image.ANTIALIAS)
ifxin [2, 13, 16, 19]:
toImage.paste(fromImage, ((x-1) *mw, y*mw))
exceptIOError:
pass
elify==4:
forxinrange(1, 21):
try:
fromImage=Image.open("C:/Users/hoo/Pictures/%s"%random.sample(names, 1)[0])
fromImage=fromImage.resize((100, 100), Image.ANTIALIAS)
ifxnotin [1, 7, 8, 14, 15, 17, 18, 20]:
toImage.paste(fromImage, ((x-1) *mw, y*mw))
exceptIOError:
pass
elifyin [5, 6]:
forxinrange(1, 21):
try:
fromImage=Image.open("C:/Users/hoo/Pictures/%s"%random.sample(names, 1)[0])
fromImage=fromImage.resize((100, 100), Image.ANTIALIAS)
ifxin [6, 9, 16, 19]:
toImage.paste(fromImage, ((x-1) *mw, y*mw))
exceptIOError:
pass
forxinrange(1, 21):
ifxin [2, 4, 6, 11, 17]:
foryinrange(13, 18):
try:
fromImage=Image.open("C:/Users/hoo/Pictures/%s"%random.sample(names, 1)[0])
fromImage=fromImage.resize((100, 100), Image.ANTIALIAS)
toImage.paste(fromImage, ((x-1) *mw, y*mw))
exceptIOError:
pass
ifxin [3, 5, 12, 18]:
y=13
try:
fromImage=Image.open("C:/Users/hoo/Pictures/%s"%random.sample(names, 1)[0])
fromImage=fromImage.resize((100, 100), Image.ANTIALIAS)
toImage.paste(fromImage, ((x-1) *mw, y*mw))
exceptIOError:
pass
ifxin [10, 16]:
foryin (13, 17):
try:
fromImage=Image.open("C:/Users/hoo/Pictures/%s"%random.sample(names, 1)[0])
fromImage=fromImage.resize((100, 100), Image.ANTIALIAS)
toImage.paste(fromImage, ((x-1) *mw, y*mw))
exceptIOError:
pass
toImage.show()
toImage.save('C:/Users/hoo/Desktop/ta.jpg')