質問するログイン新規登録

回答編集履歴

1

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

2018/02/04 16:13

投稿

umyu
umyu

スコア5846

answer CHANGED
@@ -24,4 +24,37 @@
24
24
  if __name__ == '__main__':
25
25
  #test_create_dir()
26
26
  main()
27
+ ```
28
+ ---
29
+ 2018/02/05追記
30
+ ご要望の正規表現ではありませんが、改訂された質問内容に対応する削除処理を記載しておきます。
31
+
32
+ ```Python
33
+ # -*- coding: utf8 -*-
34
+ from itertools import starmap, product, repeat
35
+ from pathlib import Path
36
+ import shutil
37
+ folder = 'X'
38
+
39
+
40
+ def sub_dir() -> map:
41
+ return map(''.join, zip(repeat('a'), map(str, range(101))))
42
+
43
+
44
+ def main() -> None:
45
+ for p in starmap(Path, product(folder, sub_dir(), 'st')):
46
+ print(p)
47
+ #shutil.rmtree(str(p))
48
+
49
+
50
+ def test_create_dir() -> None:
51
+ for p in starmap(Path, product(folder, sub_dir(), 'stuv')):
52
+ p.mkdir(parents=True, exist_ok=True)
53
+
54
+
55
+ if __name__ == '__main__':
56
+ # テストのためのディレクトリ作成!
57
+ #test_create_dir()
58
+ main()
59
+
27
60
  ```