Unicode编码错误(python)

2024-03-28 11:59:54 发布

您现在位置:Python中文网/ 问答频道 /正文

我得到以下Python错误-

Unicode Encode Error charmap codec cannot encode character '\u2026' in position 143 character maps to <undefined> 

下面是代码

from twython import Twython
consumer_key
consumer_secret
access_key
access_sceret
t=Twython(app_key=consumer_key,app_secret=consumer_secret,oauth_token=access_key,oauth_token_secret=access_sceret)

search = t.search(q='#tiago',count=100)

tweets = search['statuses']

for tweet in tweets:
  print (tweet['id_str'], '\n', tweet['text'], '\n\n\n')

**我使用命令-python setup.py install解压目录中的Twython模块,该目录与我的代码所在的目录不同


Tags: key代码in目录tokenappsearchsecret