def insert_sql(*args, **kw): for k in kw: SQL_INSERT = "insert into nostray(%s) values('%s')" % (k, kw[k]) return SQL_INSERT sql = insert_sql(userid="ka")
比如传入userid=“a”到里面就是insert into nostray(userid) values("a")
但是传入userid="a", username="b"就不是 insert into nostray(userid, username) values("a", "b")
这样的话怎么写?谢谢
ruibin