0
all。about pyqt5 about button.clicked.connect
mk_btn
をクリックしたときに空白にしたいのですが、その額はcntです。だから私はself.resultTable.setRowCount(cnt)
を使用し、私はcs_btnをcliked場合は、私はget_inという名前の関数を使用したい。 get_inにはcntが必要です。 しかしself.cs_btn.clicked.connect(self.get_in(cnt))
はcntを取らない。 どうすれば修正できますか?
私を助けてください。
class MyWindow(QMainWindow, form_class):
def __init__(self):
super().__init__()
self.setupUi(self)
self.kiwoom = Kiwoom()
self.kiwoom.commConnect()
self.mk_btn.clicked.connect(self.makelist)
self.cs_btn.clicked.connect(self.get_in(cnt))
def makelist(self):
self.kiwoom.getConditionLoad()
self.kiwoom.sendCondition("0154", self.kiwoom.condition[0], 0, 1)
cnt = len(self.kiwoom.cl)
self.resultTable.setRowCount(cnt)
return cnt
def get_in(self, cnt):
print(cnt)
for i in range(cnt):
self.kiwoom.dynamicCall("SetInputValue(QString, QString)", "종목코드", self.kiwoom.cl[i])
self.kiwoom.dynamicCall("CommRqData(QString, QString, int, QString)", "주식기본정보요청", "opt10001", 0, "0101")
print(self.kiwoom.name2)
"""
self.resultTable.setItem(i, 0, QTableWidgetItem(self.kiwoom.cl[i]))
self.resultTable.setItem(i, 1, QTableWidgetItem(self.kiwoom.name2))
self.resultTable.setItem(i, 3, QTableWidgetItem(self.kiwoom.per2))
self.resultTable.setItem(i, 4, QTableWidgetItem(self.kiwoom.pbr2))
"""
time.sleep(0.5)