我想写一个函数,能向指定的表中插入一些数据,但是参数怎么传递 不清楚,麻烦大家帮忙改一下,没加入table之前函数能正常使用
def mysql_insert(table,date,high,low): try: param=[table,date,high,low] sql="INSERT INTO table (date,high,low) VALUES(%s,%s,%s)" cur.execute(sql,param) conn.commit() except: return 0
认证0级讲师
私は pymysql を使用したことがありませんが、これであなたの機能を実現できます:
私は pymysql を使用したことがありませんが、これであなたの機能を実現できます:
リーリー