回答編集履歴

1

d

2019/09/20 05:01

投稿

tiitoi
tiitoi

スコア21956

test CHANGED
@@ -35,3 +35,33 @@
35
35
  # c
36
36
 
37
37
  ```
38
+
39
+
40
+
41
+ ## pathlib を使ったやり方
42
+
43
+
44
+
45
+ ```python
46
+
47
+ from pathlib import Path
48
+
49
+
50
+
51
+ paths = ["test/a.wav", "test/b.txt", "test/c.png"]
52
+
53
+
54
+
55
+ for p in paths:
56
+
57
+ name = Path(p).stem
58
+
59
+ print(name)
60
+
61
+ # a
62
+
63
+ # b
64
+
65
+ # c
66
+
67
+ ```