質問編集履歴
1
誤記があったため
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
```
|
8
8
|
|
9
|
-
import time,shutil
|
9
|
+
import time,shutil,glob
|
10
10
|
|
11
11
|
from concurrent import futures
|
12
12
|
|
@@ -24,19 +24,29 @@
|
|
24
24
|
|
25
25
|
|
26
26
|
|
27
|
+
r_1 = glob.glob(r1 + "\*.png")
|
28
|
+
|
29
|
+
r_2 = glob.glob(r2 + "\*.png")
|
30
|
+
|
31
|
+
|
32
|
+
|
27
33
|
t1 = time.time()
|
28
34
|
|
29
35
|
|
30
36
|
|
31
|
-
def func1(
|
37
|
+
def func1():
|
32
38
|
|
39
|
+
for path1 in r_1:
|
40
|
+
|
33
|
-
shutil.move(a
|
41
|
+
shutil.move(path1,r1 + "\" + os.path.basename(path1) + ".png" )
|
34
42
|
|
35
43
|
|
36
44
|
|
37
|
-
def func2(
|
45
|
+
def func2():
|
38
46
|
|
47
|
+
for path2 in r_2:
|
48
|
+
|
39
|
-
shutil.move(a2,r2 + "\" + os.path.basename(
|
49
|
+
shutil.move(path2,r2 + "\" + os.path.basename(path2) + ".png" )
|
40
50
|
|
41
51
|
|
42
52
|
|
@@ -44,17 +54,15 @@
|
|
44
54
|
|
45
55
|
with futures.ThreadPoolExecutor() as executor:
|
46
56
|
|
47
|
-
for path in input_dir.glob("**/*.jpg"):
|
48
|
-
|
49
57
|
|
50
58
|
|
51
59
|
# タスクを追加する。
|
52
60
|
|
53
|
-
future1 = executor.submit(func1
|
61
|
+
future1 = executor.submit(func1)
|
54
62
|
|
55
63
|
future1.setDaemon(True)
|
56
64
|
|
57
|
-
future2 = executor.submit(func2
|
65
|
+
future2 = executor.submit(func2)
|
58
66
|
|
59
67
|
|
60
68
|
|