본문 바로가기
파이썬

파이썬 TypeError : 'NoneType'객체는 Python에서 반복 할 수 없습니다.

by º기록 2020. 10. 31.
반응형

오류 TypeError : 'NoneType'object is not iterable 은 무엇을 의미합니까?

이 Python 코드에서 얻고 있습니다.

def write_file(data, filename): # creates file and writes list to it
  with open(filename, 'wb') as outfile:
    writer = csv.writer(outfile)
    for row in data: # ABOVE ERROR IS THROWN HERE
      writer.writerow(row)

 

해결 방법

 

이는 data 의 값이 None 임을 의미합니다.

 

참조 페이지 https://stackoverflow.com/questions/3887381

 

 

반응형

댓글