2
我有我的脚本函数传递值的一类方法,其工作是填充其分配的数据库与它收到的变量。事情是,我不确定正确的语法,因为我不使用普通字符串。这是方法。
def new_response(self, link_pattern, link, response, ref_id=""):
self.db_cursor.execute('''INSERT INTO tb_memory VALUES
(%s, %s, %s, %s)''' % (ref_id, link_pattern, link, response))
什么是最合适的句法?
也许值得注意的是,在这里作为参数传递时,'None'将被视为'NULL'(未知)值:这就是问题的症结所在。 –