Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. (1, 'PENELOPE'**,** 'GUINESS'**,** datetime.datetime(2006, 2, 15, 4, 34, 33))
  2. (2, 'NICK'**,** 'WAHLBERG'**,** datetime.datetime(2006, 2, 15, 4, 34, 33))
  3. (3, 'ED'**,** 'CHASE', datetime.datetime(2006, 2, 15, 4, 34, 33))
  4. (4, 'JENNIFER'**,** 'DAVIS'**,** datetime.datetime(2006, 2, 15, 4, 34, 33))
  5. (5, 'JOHNNY'**,** 'LOLLOBRIGIDA'**,** datetime.datetime(2006, 2, 15, 4, 34, 33))
  6.  
  7. import mysql.connector
  8.  
  9. mydb = mysql.connector.connect(
  10. host="localhost",
  11. user="root",
  12. passwd="2153417",
  13. database="sakila"
  14. )
  15. tweets = open("keywords.txt", "w")
  16. mycursor = mydb.cursor()
  17. mycursor.execute("SELECT * FROM actor")
  18.  
  19. with open("C:/Users/Erhan/PycharmProjects/MySQL/keywords.txt", "w", newline='') as f:
  20. for row in mycursor:
  21. print(row, file=f)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement