Python Forum

Full Version: Textblob issue on 3.5
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey everyone!

I have to use Textblob to translate a sentence to either Spanish or Arabic.

Before I begin, I am running Ubuntu and boot up python via the "idle3" command.

I have code for it on ready to go on 3.5 but it doesn't show work.

However, when I boot up 2.7 using "idle" it works just fine.

Can someone please help me figure out why it's not working on 3.5? I followed the directions on the Textblob website and the assignment is due tomorrow. I've spent the last few days searching Google and even put it up as a question on Stack Overflow with no results.

Any help would be greatly appreciated :D


EDIT: This is the code we started off with in the assignment to work off of.

from textblob import TextBlob

userInput = TextBlob("How are you?")

translation = userInput.translate(to='ar')
print (translation)
EDIT 2:

This is what I have in 2.7

from textblob import TextBlob

userInput =  TextBlob raw_input("Type sentence: ") 

translation = userInput.translate(to='es')
print (translation)
Do you get any traceback/error message?
1. Stick to python 3, don't mix with python 2
2. how would you replace the hardcoded text "How are you?" from the example with user input?