Код: Выделить всё
conn = pymysql.connect(...)
with conn.cursor() as cursor:
cursor.execute(...)
...
conn.close()
(оно выполняется успешно)
Код: Выделить всё
import pymysql
with pymysql.connect(...) as cursor:
cursor.execute('show tables')
Подробнее здесь: https://stackoverflow.com/questions/312 ... -statement
Мобильная версия