Skip to content

Commit 03223f8

Browse files
committed
edit File I/O Example
1 parent 34d8d93 commit 03223f8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

file_IO_Translator.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
with open('./test.txt', mode='r') as my_file:
66
text = my_file.read()
77
translation = translator.translate(text)
8-
print(translation)
8+
with open('./test-ja.txt', mode='w') as my_file2:
9+
my_file2.write(translation)
910
except FileNotFoundError as e:
10-
print('check your file path!')
11+
print('check your file path!')

0 commit comments

Comments
 (0)