本质上应该发生的是从数据库表中获取一些包含id的信息。在数据库中找到input.text()元素之一作为ID之一的情况下,我希望它运行X,但会绕过并运行Y
`DBConnect = pyodbc.connect('Driver={Microsoft Access Driver (*.mdb, *.accdb)}; Dbq=C:\\A\\B\\C;')
DBSelect = DBConnect.cursor()
DBSelect.execute("select * from ...)
Row = DBSelect.fetchall()
Update = False
for field in Row:
Appointment_ID = field[0]
print(Appointment_ID)
Selected_ID = self.ui.input.text()
Selected_ID = str(Selected_ID)
print(Selected_ID, "this is selected")
print(Update)
if Appointment_ID == Selected_ID:
Update = True
print(Update, "this is update")
if Update == True:
run X
else:
run Y`
下面是当我输入141时在运行该代码时产生的打印输出,正如您所看到的,它不会产生Update=True输出
第139页, 141选择此选项, 假的, 140, 141选择此选项, 假的, 141, 141选择此选项, 假的, False这是更新
你有窃听器。Update==True应该是Update=True,在循环内
相关问题 更多 >
编程相关推荐