Skip to content

Instantly share code, notes, and snippets.

@Yatoom
Created October 15, 2016 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yatoom/068512b00bdf55e631e949b9fe6ced4d to your computer and use it in GitHub Desktop.
Save Yatoom/068512b00bdf55e631e949b9fe6ced4d to your computer and use it in GitHub Desktop.
import pymysql.cursors
connection = pymysql.connect(host='localhost', user='slayer', password='', db='rumor_slayer', charset='utf8mb4', cursorclass=pymysql.cursors.DictCursor)
with connection.cursor() as cursor:
sql = "SELECT text FROM tweets"
cursor.execute(sql)
result = cursor.fetchall()
for tweet in result:
print(tweet['text'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment