2
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 this error

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

Can someone help me?

1
  • 2
    The twitter module you're using doesn't have username and password arguments to the API constructor. Have you read the documentation? Commented Mar 16, 2011 at 18:04

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

Comments

1

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')

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.