我正在使用GUI来阅读基于python 2.7的推文。
当我通过Eclipse和PyDev运行脚本时,一切正常。但是在使用gui2exe / py2exe编译之后,我收到此错误消息:
twython.exceptions.TwythonAuthError: Unable to obtain OAuth 2 access token
代码是:
CONSUMER_KEY = '****'
CONSUMER_SECRET = '****'
ACCESS_KEY = '****'
ACCESS_SECRET = '****'
twitter = Twython(CONSUMER_KEY, CONSUMER_SECRET, oauth_version=2)
ACCESS_TOKEN = twitter.obtain_access_token()
if settings.value("Proxys").toBool() == True:
httpproxy = settings.value ("HttpProxy").toString()
httpsproxy = settings.value ("HttpsProxy").toString()
proxystring = "'http': '%s','https': '%s'" % (httpproxy, httpsproxy)
client_args = {
'proxies': {
proxystring,
}
}
self.api = Twython(CONSUMER_KEY, access_token=ACCESS_TOKEN, client_args=client_args)
else:
self.api = Twython(CONSUMER_KEY, access_token=ACCESS_TOKEN)
有人可以帮忙吗?