如果只想执行一条语句,则可以直接使用引擎,它将为您打开和关闭连接:
result = engine.execute('SELECT price FROM products') for row in result: print('Price:', row['price'])