Bandna Prasher Bandna Prasher - 2 months ago 25
Python Question

Textblob module in python is not working for me

Here is the code...

import textblob
While True:
print("Ok...")
print("Enter the text....")
text = input()
blob = textblob.TextBlob(text)
blob.translate(to = "de")


It ask for text and then tells me Nothing. Any help is appreciated!

BPL BPL
Answer

Here's a working example:

import textblob

while True:
    text = input("Which text you want to translate:")
    blob = textblob.TextBlob(text)
    print("--> {0}".format(blob.translate(to = "de")))

You forgot to print the German translated string