CODE : pip install translate create a new script file eg. english in the same directory. from translate import Translator translator=Translator( to_lang = "hi" ) with open ( './english.txt' , 'r' ) as file2: text=file2.read() translation=translator.translate(text) print(translation) or another way jj= str ( input ( 'enter th english' )) from translate import Translator translator=Translator( to_lang = "hi" ) with open ( './english.txt' , 'w' ) as file2: file2.write( f'-- { jj } ' ) with open ( './english.txt' , 'r' ) as file2: text = file2.read() translation=translator.translate(text) print (translation) DEMO:
Here we try to find out solutions of every why and how with the help of science.
Comments
Post a Comment