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()
评论列表
文章目录