回答編集履歴

1

質問文の改訂内容に対する処理に変更

2018/02/04 16:13

投稿

umyu
umyu

スコア5846

test CHANGED
@@ -51,3 +51,69 @@
51
51
  main()
52
52
 
53
53
  ```
54
+
55
+ ---
56
+
57
+ 2018/02/05追記
58
+
59
+ ご要望の正規表現ではありませんが、改訂された質問内容に対応する削除処理を記載しておきます。
60
+
61
+
62
+
63
+ ```Python
64
+
65
+ # -*- coding: utf8 -*-
66
+
67
+ from itertools import starmap, product, repeat
68
+
69
+ from pathlib import Path
70
+
71
+ import shutil
72
+
73
+ folder = 'X'
74
+
75
+
76
+
77
+
78
+
79
+ def sub_dir() -> map:
80
+
81
+ return map(''.join, zip(repeat('a'), map(str, range(101))))
82
+
83
+
84
+
85
+
86
+
87
+ def main() -> None:
88
+
89
+ for p in starmap(Path, product(folder, sub_dir(), 'st')):
90
+
91
+ print(p)
92
+
93
+ #shutil.rmtree(str(p))
94
+
95
+
96
+
97
+
98
+
99
+ def test_create_dir() -> None:
100
+
101
+ for p in starmap(Path, product(folder, sub_dir(), 'stuv')):
102
+
103
+ p.mkdir(parents=True, exist_ok=True)
104
+
105
+
106
+
107
+
108
+
109
+ if __name__ == '__main__':
110
+
111
+ # テストのためのディレクトリ作成!
112
+
113
+ #test_create_dir()
114
+
115
+ main()
116
+
117
+
118
+
119
+ ```