Repository navigation
Home
Hongkun Jin edited this page Sep 20, 2018
·
4 revisions
Welcome to the Personal_Blogs wiki!
THIS IS PERSONAL WIKI BLOGS ABOUT EVERYTHING IN MY LIFE, HARDWARE/SOFTWARE/SOLUTIONS///
NOW OR NEVER!
/'this is the code'
#include <stdio.h>
int main(void)
*{ char Name='H'; do{ print("P* lease enter the first words of your name!"); scanf("%c",&Name); }while(Name!='xiao');
121212* 1213
-
k *kk
print("Welcome to the MarkDown World!Xiao-Miao blog!"); return 0; } )
class StdOutlistener(StreamListener):
def on_data(self, data):
all_data = json.loads(data)
tweet = TextBlob(all_data["text"])
#Add the 'sentiment data to all_data
all_data['sentiment'] = tweet.sentiment
print tweet
print tweet.sentiment
# Open json text file to save the tweets
with open('tweets.json', 'a') as tf:
# Write a new line
tf.write('\n')
# Write the json data directly to the file
json.dump(all_data, tf)
# Alternatively: tf.write(json.dumps(all_data))
return True
def on_error(self, status):
print(status)