Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pymysql.cursors
- import random
- # Подключиться к базе данных.
- connection = pymysql.connect(host='localhost',
- user='root',
- password='power2000',
- db='students',
- charset='utf8mb4',
- cursorclass=pymysql.cursors.DictCursor)
- print ("connect successful!!")
- try:
- with connection.cursor() as cursor:
- while True:
- finally:
- # Закрыть соединение (Close connection).
- connection.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement