通过Python流推文

I am using twiiter streaming api and twython module with python 2.7 windows 7 os. I want to click a button and streaming of tweets should start. and on clicking the streaming should stop.I am using python for backend and HTML on front end.I am communicating to python via php using passthru function.when i am giving an ajax call to php on clicking of button then all the tweets is displayed at a time. I want streaming.Can anyone help?Thanks

There are several twitter api libraries for python that have support for the streaming API. Use whichever you find convenient -

  1. Twython - https://github.com/ryanmcgrath/twython
  2. Tweepy - https://github.com/tweepy/tweepy
  3. TitterAPI - https://github.com/geduldig/TwitterAPI

All of them have decent documentation & examples. If you run across any bugs/errors, please refer to their corresponding existing bug lists first.

I am using twython and using long polling technique for displaying the streams.