mysql_try

Run Settings
LanguagePython
Language Version
Run Command
import pymysql def db_connection(): try: connection = pymysql.connect( host = 'localhost', user = 'root', database = 'colour_picker', passwd = 'pwd here', autocommit = True #? ) return connection except Exception as ex: print('Ошибка соединения') print(ex) #connection = db_connection() #cursor = connection.cursor() #connection.close() cursor = db_connection().cursor() cursor.execute("SELECT * FROM palette;") all_offer = cursor.fetchall() print(all_offer) cursor.close()
Editor Settings
Theme
Key bindings
Full width
Lines