How to save a tweepy Twitter stream to a file?

前端 未结 2 693
盖世英雄少女心
盖世英雄少女心 2020-12-31 20:21

I have a working script that successfully gathers tweets that mention \"stackoverflow\". However, I want to run the script in iPython (rather than executive a separate .py f

2条回答
  •  无人及你
    2020-12-31 21:03

    You can do it by redirecting output to a file:

    in Terminal/CMD just type python twitter_streaming.py > twitter_data.txt

    for appending to an existing file use >> instead of >.

提交回复
热议问题