Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Question

Rollback to Revision 2
Source Link
jonrsharpe
  • 123.4k
  • 31
  • 278
  • 489

I have some text that I am trying to decode and encode in Python.

import html.parser
original_tweet=original_tweet = "I luv my <3 iphone & you’re awsm 
 apple.DisplayIsAwesome, sooo happppppy 🙂 
 http://www.apple.com"
tweet = original_tweet.decode("utf8").encode('ascii', 'ignore')

I have entered the original tweet on one line via Spyderin Spyder (Python 3.6)

I get the following messageAttributeError: 'str' object has no attribute 'decode'

AttributeError: 'str' object has no attribute 'decode'

Is there an alternative way to rewrite this code for Python 3.6?

Any help would be appreciated.

Thanks in advance.

I have some text that I am trying to decode and encode in Python.

import html.parser
original_tweet= "I luv my <3 iphone & you’re awsm 
 apple.DisplayIsAwesome, sooo happppppy 🙂 
 http://www.apple.com"
tweet = original_tweet.decode("utf8").encode('ascii', 'ignore')

I have entered the original tweet on one line via Spyder (Python 3.6)

I get the following messageAttributeError: 'str' object has no attribute 'decode'

Is there an alternative way to rewrite this code for Python 3.6?

Any help would be appreciated.

Thanks in advance.

I have some text that I am trying to decode and encode in Python

import html.parser
original_tweet = "I luv my <3 iphone & you’re awsm 
 apple.DisplayIsAwesome, sooo happppppy 🙂 
 http://www.apple.com"
tweet = original_tweet.decode("utf8").encode('ascii', 'ignore')

I have entered the original tweet on one line in Spyder (Python 3.6)

I get the following message

AttributeError: 'str' object has no attribute 'decode'

Is there an alternative way to rewrite this code for Python 3.6?

I have some text that I am trying to decode and encode in Python.

import html.parser
original_tweet =original_tweet= "I luv my <3 iphone & you’re awsm 
 apple.DisplayIsAwesome, sooo happppppy 🙂 
 http://www.apple.com"
tweet = original_tweet.decode("utf8").encode('ascii', 'ignore')

I have entered the original tweet on one line in Spydervia Spyder(Python 3.6)

I get the following messageAttributeError: 'str' object has no attribute 'decode'

AttributeError: 'str' object has no attribute 'decode'

Is there an alternative way to rewrite this code for Python 3.6?

Any help would be appreciated.

Thanks in advance.

I have some text that I am trying to decode and encode in Python

import html.parser
original_tweet = "I luv my <3 iphone & you’re awsm 
 apple.DisplayIsAwesome, sooo happppppy 🙂 
 http://www.apple.com"
tweet = original_tweet.decode("utf8").encode('ascii', 'ignore')

I have entered the original tweet on one line in Spyder (Python 3.6)

I get the following message

AttributeError: 'str' object has no attribute 'decode'

Is there an alternative way to rewrite this code for Python 3.6?

I have some text that I am trying to decode and encode in Python.

import html.parser
original_tweet= "I luv my <3 iphone & you’re awsm 
 apple.DisplayIsAwesome, sooo happppppy 🙂 
 http://www.apple.com"
tweet = original_tweet.decode("utf8").encode('ascii', 'ignore')

I have entered the original tweet on one line via Spyder(Python 3.6)

I get the following messageAttributeError: 'str' object has no attribute 'decode'

Is there an alternative way to rewrite this code for Python 3.6?

Any help would be appreciated.

Thanks in advance.

deleted 17 characters in body
Source Link
jonrsharpe
  • 123.4k
  • 31
  • 278
  • 489

I have some text that I am trying to decode and encode in Python

import html.parser
original_tweet = "I luv my <3 iphone & you’re awsm 
 apple.DisplayIsAwesome, sooo happppppy 🙂 
 http://www.apple.com"
tweet = original_tweet.decode("utf8").encode('ascii', 'ignore')

I have entered the original tweet on one line in Spyder (Python 3.6)

I get the following message AttributeError: 'str' object has no attribute 'decode'

AttributeError: 'str' object has no attribute 'decode'

Is there an alternative way to rewrite this code for Python 3.6?

Thanks in advance.

I have some text that I am trying to decode and encode in Python

import html.parser
original_tweet = "I luv my <3 iphone & you’re awsm 
 apple.DisplayIsAwesome, sooo happppppy 🙂 
 http://www.apple.com"
tweet = original_tweet.decode("utf8").encode('ascii', 'ignore')

I have entered the original tweet on one line in Spyder (Python 3.6)

I get the following message AttributeError: 'str' object has no attribute 'decode'

Is there an alternative way to rewrite this code for Python 3.6?

Thanks in advance.

I have some text that I am trying to decode and encode in Python

import html.parser
original_tweet = "I luv my <3 iphone & you’re awsm 
 apple.DisplayIsAwesome, sooo happppppy 🙂 
 http://www.apple.com"
tweet = original_tweet.decode("utf8").encode('ascii', 'ignore')

I have entered the original tweet on one line in Spyder (Python 3.6)

I get the following message

AttributeError: 'str' object has no attribute 'decode'

Is there an alternative way to rewrite this code for Python 3.6?

Source Link
cordelia
  • 133
  • 3
  • 15
Loading
lang-py

AltStyle によって変換されたページ (->オリジナル) /