質問編集履歴

1

コード修正の追加

2019/06/18 01:55

投稿

dokidoki_hamuo
dokidoki_hamuo

スコア38

test CHANGED
File without changes
test CHANGED
@@ -99,3 +99,39 @@
99
99
 
100
100
 
101
101
  ```
102
+
103
+ ### 追加した場所
104
+
105
+ ```python
106
+
107
+
108
+
109
+ import os
110
+
111
+ from PIL import Image
112
+
113
+ import shutil
114
+
115
+ myphoto =[]
116
+
117
+ for filename in os.listdir('.'):
118
+
119
+ if filename.endswith('.jpg') or filename.endswith('.png'):
120
+
121
+ myphoto.append(filename)
122
+
123
+
124
+
125
+ for filename in myphoto:
126
+
127
+ pict = Image.open(filename)
128
+
129
+ width, height = pict.size
130
+
131
+ if width < 1280:
132
+
133
+ shutil.move(filename,r'C:\Users\userid123\Desktop\作業\python\test用')
134
+
135
+ pict.close()
136
+
137
+ ```