google translate python tutorial code example
Example 1: translate sentences in python
pip install translate
from translate import Translator
translator= Translator(from_lang="german",to_lang="spanish")
translation = translator.translate("Guten Morgen")
print(translation)
Example 2: python google translate api
import pandas as pd
from google_trans_new import google_translator
translator = google_translator()
translate_text = translator.translate('Hola mundo!', lang_src='es', lang_tgt='en')
print(translate_text)