Skip to content

Commit 6d14a1b

Browse files
authored
Create 35_main_translate.py
1 parent cb448c2 commit 6d14a1b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎scripts/35_main_translate.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
fromtranslateimportTranslator
2+
translator=Translator(to_lang="ja") #en es pt zh
3+
4+
try :
5+
withopen('tot.txt',mode='r') asmy_file:
6+
text=my_file.read()
7+
translation=translator.translate(text)
8+
print(translation)
9+
exceptFileNotFoundErroraser:
10+
print('you wrote wrong directory')

0 commit comments

Comments
(0)