回答編集履歴

1

ループ処理も含めて記述

2020/10/17 01:08

投稿

Daregada
Daregada

スコア11990

test CHANGED
@@ -1,20 +1,24 @@
1
1
  ```Python
2
2
 
3
- filename = 'NC_20180912_1500_r14_02601.csv'
4
-
5
- filename_parts = filename.split('_')
3
+ import glob
6
4
 
7
5
 
8
6
 
9
- graphname = filename_parts[1] + '_' + filename_parts[2]
7
+ for filename in glob.glob('NC_20180912_*.csv'):
10
8
 
11
- graphfilename = graphname + '.png'
9
+ filename_parts = filename.split('_')
12
10
 
13
11
 
14
12
 
15
- print(graphname)
13
+ graphname = filename_parts[1] + '_' + filename_parts[2]
16
14
 
15
+ graphfilename = graphname + '.png'
16
+
17
+
18
+
19
+ print(graphname)
20
+
17
- print(graphfilename)
21
+ print(graphfilename)
18
22
 
19
23
  ```
20
24
 
@@ -26,4 +30,14 @@
26
30
 
27
31
  20180912_1500.png
28
32
 
33
+ 20180912_1510
34
+
35
+ 20180912_1510.png
36
+
37
+ 20180912_1600
38
+
39
+ 20180912_1600.png
40
+
41
+
42
+
29
43
  ```