Reputation: 13
i am building a translator that translates user input to french using python. I am however encountering a challenge where my goslate function does not catch user input and translate it. I will appreciate your help.
import goslate
gs = goslate.Goslate()
text = input("please input the word you would like translated:\n")
gs.translate(text,'fr')
Upvotes: 1
Views: 590
Reputation: 477
You have to print the output or save it to a variable. E.g.
import goslate
gs = goslate.Goslate()
text = input("please input the word you would like translated:\n")
print(gs.translate(text,'fr'))
Output:
please input the word you would like translated:
Hello
Bonjour
Check the documentation for more details.
Upvotes: 1