import twitter
api = twitter.Api(consumer_key=' ',
consumer_secret=' ',
access_token_key=' ',
access_token_secret=' ')
friends=api.PostUpdate("First Tweet from PYTHON APP ")
Я сделал все, как сказано в http://abhi74k.wordpress.com/2010/12/21/tweeting-from-python/, но когда я заполнил его и нажал ввод, ничего не происходит.Можете ли вы помочь мне с этим?
Хорошо, это из-за того, что я не мог правильно загрузить API Python-Twitter.Это дает мне эту ошибку, когда я пытаюсь выполнить следующие шаги:
figen@figen-Satellite-A350:~/Downloads/python-twitter-0.8.2$ python setup.py install
running install
running build
running build_py
running install_lib
copying build/lib.linux-x86_64-2.7/twitter.py -> /usr/local/lib/python2.7/dist-packages
error: /usr/local/lib/python2.7/dist-packages/twitter.py: Permission denied
http://code.google.com/p/python-twitter/
Хорошо, я установил setup.py
, но теперь выдает эту ошибку:
figen@figen-Satellite-A350:~/Downloads/python-twitter-0.8.2$ python twitter_test.py
Traceback (most recent call last):
File "twitter_test.py", line 29, in <module>
import twitter
File "/home/figen/Downloads/python-twitter-0.8.2/twitter.py", line 65, in <module>
import oauth2 as oauth
ImportError: No module named oauth2
Теперь там написано, что в модуле Twitter модуля нет.Как это получить?
api = twitter.Api(consumer_key='removed',
consumer_secret='removed',
access_token_key='removed',
access_token_secret='removed')
friends=api.PostUpdate("If you see this,I managed to send my first tweet from Python Shell. Yay! =)")
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
api = twitter.Api(consumer_key='removed for security=)',
AttributeError: 'module' object has no attribute 'Api'