Artificial intelligent assistant

pythonの文字コード変換する CSV utf_8shift_jis # tweet_data = [] for tweet in tweepy.Cursor(api.user_timeline,screen_name = "beechhangergals",exclude_replies = True).items(): tweet_data.append([tweet.id,tweet.created_at,tweet.text.replace('\n',''),tweet.favorite_count,tweet.retweet_count]) #csv with open('tweets.csv', 'w',newline='',encoding='utf_8') as f: writer = csv.writer(f, lineterminator='\n') writer.writerow(["id","created_at","text","fav","RT"]) writer.writerows(tweet_data) pass

Ubuntulessfile:


apt install less file


:


for tweet in tweepy.Cursor(api.user_timeline,screen_name = "beechhangergals",exclude_replies = True).items():
tweet_data.append([tweet.id,tweet.created_at,tweet.text.replace('\
',''),tweet.favorite_count,tweet.retweet_count])
break #break





less tweets.csv


:


file -i tweets.csv


[]


tweets.csv: text/plain; charset=utf-8


csvutf-8

python:


python --version


23


apt install python3 python3-pip
python3 script.py


2019/10/08 tweepy `tweepy==3.8.0`


pip3 install -U tweepy


ExcellessEmacsVim

OSUbuntu:
<

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 959fc4b5979714ef85c82001d0451927