回答編集履歴
1
修正
test
CHANGED
@@ -1,12 +1,9 @@
|
|
1
|
-
|
1
|
+
書き込みファイルは各読取~計算ループの外側で開く必要があります。
|
2
2
|
```Python
|
3
|
+
with open('data.csv', 'wt', encoding='utf-8') as fout:
|
3
|
-
for fn in sys.argv[1:]:
|
4
|
+
for fn in sys.argv[1:]:
|
4
|
-
with open(fn, 'r', encoding='Shift_JIS') as file:
|
5
|
-
|
5
|
+
# 略
|
6
|
-
|
7
|
-
path = fn + '_ret.csv' # 適当な別ファイル名
|
8
|
-
|
6
|
+
data = ','.join([str(max),str(min),str(avg)])
|
9
|
-
dataWriter = csv.writer(file)
|
10
|
-
|
7
|
+
fout.write(data + '\n')
|
11
8
|
```
|
12
9
|
|