data_from_ids.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:TwitterBotClassifier 作者: JVogel27 项目源码 文件源码
def get_data_from_humans():
    try:
        x = []
        with open('..//human_x.txt', 'r') as f:
            reader = csv.reader(f)
            for row in reader:
                x.append(row)

        os.remove('..//human_x.txt')

        with open('..//humans_copy.txt', 'r') as f_read:
            with open('..//human_x.txt', 'w') as f_write:
                writer = csv.writer(f_write, lineterminator='\n')
                for row in x:
                    writer.writerow(row)
                for count, line in enumerate(f_read):

                    row = get_data(line.rstrip(), api)

                    writer.writerow(row)

                    print(line)

    except tweepy.TweepError:
        f_write.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号