更新时间:2022-04-30 10:04:42
使用此:
cur.executemany("INSERT INTO test4 VALUES ('{0}')".format(readAll))
或(readAll,):
cur.executemany("INSERT INTO test4 VALUES (%s)", (readAll,))
请参阅: http://initd.org /psycopg/docs/usage.html#passing-parameters-to-sql-queries