need help with a translation issue
dn
PythonList at DancesWithMice.info
Sat Apr 17 19:57:15 EDT 2021
On 18/04/2021 10.56, Quentin Bock wrote:
> I'm trying to take the user input and let them change the target language
> or dest
> code:
>
...
> language_list = googletrans.LANGUAGES
> print(language_list)
...
> user_choice = input ("Enter a language (the abbreviation or correctly
> spelled name of the language): ").lower()
...
> user_translation = GoogleTranslator(source='en',
> target=user_choice).translate(user_sentence)
Where is the "user_choice" related back to "language_list"?
Alternately, what's there to stop some nefarious/stupid user (like me!)
entering "gobbledegook" and complaining that the program fails?
--
--
Regards,
=dn
More information about the Python-list
mailing list