파이썬에서 리스트를 만들고 실행 시
for i in range(1, 6):
item = QTableWidgetItem(self.kiwoom.opw00018_output['single'][i - 6])
IndexError: list index out of range
Process finished with exit code 1
이런 에러가 뜨는 것이 보이는데
IndexError: list index out of range 에러는
list 범위 밖에 있는 인덱스를 가져오려고 해서 에러가 난 것이다
item = QTableWidgetItem(self.kiwoom.opw00018_output['single'][i - 2])
로 바꾸니 정상실행되었다
#파이썬 #에러해결 #python
