开发者

python-Twitter-api

import twitter

client = twitter.Api()

client = twitter.Api(username='uname', password='password')

update = client.PostUpdate('Tweetin from python!')

This is my code. When i execute this program i get th开发者_运维技巧is error

TypeError: __init__() got an unexpected keyword argument 'username'

Can someone help me?


take a look at this tutorial Twitter From the Command Line in Python Using OAuth


Per the documentation, you have to use OAuth, and specify keys and access tokens in the API constructor: http://code.google.com/p/python-twitter/

>>> api = twitter.Api(consumer_key='consumer_key',
consumer_secret='consumer_secret', access_token_key='access_token', access_token_secret='access_token_secret')
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜