回答編集履歴
2
ブンポウ
test
CHANGED
@@ -4,11 +4,11 @@
|
|
4
4
|
|
5
5
|
with open(filepath, "r+" ...) as csvFile:
|
6
6
|
|
7
|
-
csvFile.seek(0)
|
8
|
-
|
9
7
|
target = list(csvFile.read())
|
10
8
|
|
11
9
|
target.insert(0, "入れたい文字列")
|
10
|
+
|
11
|
+
csvFile.seek(0)
|
12
12
|
|
13
13
|
csvFile.write("".join(target))
|
14
14
|
|
1
修正
test
CHANGED
@@ -4,9 +4,13 @@
|
|
4
4
|
|
5
5
|
with open(filepath, "r+" ...) as csvFile:
|
6
6
|
|
7
|
-
|
7
|
+
csvFile.seek(0)
|
8
8
|
|
9
|
-
|
9
|
+
target = list(csvFile.read())
|
10
|
+
|
11
|
+
target.insert(0, "入れたい文字列")
|
12
|
+
|
13
|
+
csvFile.write("".join(target))
|
10
14
|
|
11
15
|
|
12
16
|
|