我运行Python脚本时将其挂起。不知道是什么使它卡住了。只是与必须为postgres安装新的ODBC驱动程序而战,这可能是原因吗?
import pyodbc
server = 'localhost'
database = 'screens_database'
username = 'postgres'
password = ''
driver='{ODBC Driver 17 for SQL Server}'
cxcn = pyodbc.connect('DRIVER='+driver+';SERVER='+server+';PORT=5000;DATABASE='+database+';UID='+username+';PWD='+password)
#cursor
cur = con.cursor()
cur.execute("select * from screens_database")
con.close()