回答編集履歴
2
元のソースコードにスタイルを合わせるよう修正。
test
CHANGED
@@ -6,9 +6,9 @@
|
|
6
6
|
|
7
7
|
# encoding = "cp932" # utf-8がだめならこっちを試してみてください。
|
8
8
|
|
9
|
-
|
9
|
+
f = open("filename.xml", encoding=encoding)
|
10
10
|
|
11
|
-
|
11
|
+
root = ElementTree.parse(f)
|
12
12
|
|
13
13
|
```
|
14
14
|
|
1
追記
test
CHANGED
@@ -2,7 +2,11 @@
|
|
2
2
|
|
3
3
|
```Python
|
4
4
|
|
5
|
+
encoding = "utf-8"
|
6
|
+
|
7
|
+
# encoding = "cp932" # utf-8がだめならこっちを試してみてください。
|
8
|
+
|
5
|
-
with open("filename.xml", encoding=
|
9
|
+
with open("filename.xml", encoding=encoding) as f:
|
6
10
|
|
7
11
|
root = ElementTree.parse(f)
|
8
12
|
|