简体   繁体   English

QComboBox.curfrentText() 不工作 - 我总是得到 TypeError: execute() argument 1 must be str, not tuple

[英]QComboBox.curfrentText() not working - i always get TypeError: execute() argument 1 must be str, not tuple

What's wrong with my sqlstr我的 sqlstr 有什么问题

def clicker(self):
        cursor = self.conn.cursor()
        sqlstr = ('''
                  SELECT t1.column3, t2.column2, t2.column3, t2.column4
                  FROM t1
                  INNER JOIN t2 ON t1.id_number = t2.id_number
                  WHERE t1.column3 = ? AND t2.column2 = ?''',
                  (self.qcombobox1.currentText()), (self.qcombobox2.currentText()))

I am getting TypeError: execute() argument 1 must be str, not tuple我收到 TypeError: execute() argument 1 must be str, not tuple

Thanks in advance...提前致谢...

您将execute() sqlstr作为参数,尝试用execute(*sqlstr)将元组解包为不同的参数。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 类型错误:参数 1 必须是 str,而不是元组 - TypeError: argument 1 must be str, not tuple TypeError: write() 参数必须是 str,而不是元组 | 写线(l) - TypeError: write() argument must be str, not tuple | writelines(l) 使用按钮插入数据库会创建类型错误:参数 1 必须是 str,而不是元组 - Inserting into database using pushbutton creates TypeError: argument 1 must be str, not tuple 获取类型错误:在数据库中搜索时参数 1 必须是 str,而不是元组 - Getting TypeError: argument 1 must be str, not tuple when searching in DB 我不明白为什么会这样:TypeError:getsockaddrarg:AF_INET地址必须是元组,而不是str - I understad why I get: TypeError: getsockaddrarg: AF_INET address must be tuple, not str 为什么会出现此错误:TypeError:元组索引必须是整数或切片,而不是str - Why do I get this error: TypeError: tuple indices must be integers or slices, not str 类型错误:参数 2 必须是元组或列表 - TypeError: Argument 2 must be Tuple or List 如何摆脱 TypeError:strptime() 参数 1 必须是 str,而不是在 read_csv 中浮动? - How do I get rid of TypeError: strptime() argument 1 must be str, not float in read_csv? TypeError TypeError:connect() 参数 3 必须是 str,而不是 list - TypeError TypeError: connect() argument 3 must be str, not list Tkinter类“必须不是元组” TypeError Python - Tkinter Class “must be str not tuple” TypeError Python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM