Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Textblob issue on 3.5
#1
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)
Reply
#2
Do you get any traceback/error message?
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#3
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?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Issue In Loading Textblob in jupyter Shivi_Bhatia 1 6,864 Apr-01-2019, 06:50 PM
Last Post: perfringo
  How to count value after a textblob LoliMarth 1 2,313 Mar-22-2019, 02:20 AM
Last Post: micseydel
  How to declare TextBlob var 3115Tech 2 2,743 Apr-21-2018, 07:04 PM
Last Post: 3115Tech

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020