通过PowerShell运行python脚本时出现UnicodeEncodeError

时间:2015-08-23 20:47:53

标签: python windows unicode

我正在学习Python并使用Reddit机器人,但我收到了一个错误。我想我需要更改PowerShell控制台窗口的编码,但我不确定如何。这是代码:

 error while loading shared libraries: libcaffe.so: cannot open shared object file: No such file or directory

这是错误:

#!/usr/bin/python
# -*- coding: utf-8 -*-
import praw

user_agent = ("PyEng Bot 0.1")

r = praw.Reddit(user_agent = user_agent)

subreddit = r.get_subreddit("learnpython")

for submission in subreddit.get_hot(limit = 5):
    print "Title: ", submission.title
    print "Text: ", submission.selftext
    print "Score: ", submission.score
    print "---------------------------------\n"

0 个答案:

没有答案