Powered by Blogger.

Welcome id7004e with info

IndexError: list index out of range 에러 해결방법

0 comments

 파이썬에서 리스트를 만들고 실행 시

 

for i in range(16):

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




댓글 없음:

댓글 쓰기

Blogger 설정 댓글

Popular Posts

Welcome id7004e with info

ondery

내 블로그 목록

가장 많이 본 글

기여자