Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pymysql.cursors
- connection = pymysql.connect(host="127.0.0.1", database="addressbook", user="root", password="")
- #Groups
- try:
- cursor = connection.cursor()
- cursor.execute("select * from group_list")
- for row in cursor.fetchall():
- print(row)
- finally:
- connection.close()
- #Contacts
- try:
- cursor = connection.cursor()
- cursor.execute("select * from addressbook")
- for rows in cursor.fetchall():
- print(rows)
- finally:
- connection.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement