我有一个简单的if-else语句,但是我有一个问题,为什么if条件不起作用,即使它是真的,但是当else是真的时,它工作得很好。你知道吗
有人能告诉我为什么我的if条件不起作用,即使它是真的吗?你知道吗
self.comboBoxCourse.currentIndexChanged.connect(self.courseChoosed)
这是if else语句:
def courseChoosed(self):
if self.comboBoxCourse.currentIndex() == 0:
self.pushButton_2.clicked.connect(self.courseSTEM)
print("Your Current course is STEM")
elif self.comboBoxCourse.currentIndex() == 1:
self.pushButton_2.clicked.connect(self.courseICT)
print('Your current course is ICT')
print(self.comboBoxCourse.currentIndex())
如果我选择STEM,即Index==0:这是真的,它显示的是打印消息,我不知道为什么,但按钮不起作用。你知道吗
如果组合框==1:并且按钮工作正常,则返回else语句的结果。你知道吗
有人能告诉我为什么if语句中的button函数即使是true也不起作用吗?你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐