Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (1, 'PENELOPE'**,** 'GUINESS'**,** datetime.datetime(2006, 2, 15, 4, 34, 33))
- (2, 'NICK'**,** 'WAHLBERG'**,** datetime.datetime(2006, 2, 15, 4, 34, 33))
- (3, 'ED'**,** 'CHASE', datetime.datetime(2006, 2, 15, 4, 34, 33))
- (4, 'JENNIFER'**,** 'DAVIS'**,** datetime.datetime(2006, 2, 15, 4, 34, 33))
- (5, 'JOHNNY'**,** 'LOLLOBRIGIDA'**,** datetime.datetime(2006, 2, 15, 4, 34, 33))
- import mysql.connector
- mydb = mysql.connector.connect(
- host="localhost",
- user="root",
- passwd="2153417",
- database="sakila"
- )
- tweets = open("keywords.txt", "w")
- mycursor = mydb.cursor()
- mycursor.execute("SELECT * FROM actor")
- with open("C:/Users/Erhan/PycharmProjects/MySQL/keywords.txt", "w", newline='') as f:
- for row in mycursor:
- print(row, file=f)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement