How to use Google Translate API with python

pip install googletrans
from googletrans import Translatortranslator = Translator()
translator = Translator(service_urls=['translate.google.com','translate.google.co.kr',])
translated=translator.translate(“I am a programmer”,dest=’bn’)
print(translated.origin)
print(translated.text)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store