
[코드]
import csv
def aetKev(item): # 데이터 정렬코드
return item[1]
command_data=[] # 파일 읽어오기 코
with open("command_data.csv","r") as csvfile:
spamreader=csv.reader(csvfile, delimiter=',', quotechar='"')
for row in spamreader:
command_data.append(row)
print(len(command_data))
[실행에러]
C:\workspace>python dict.py
Traceback (most recent call last):
File "dict.py", line 8, in <module>
for row in spamreader:
UnicodeDecodeError: 'cp949' codec can't decode byte 0x80 in position 590: illegal multibyte sequence
파일을 읽어올 때 몇 개 글자가 읽어지지 않는 현상인거 같습니다.
아래처럼 코드를 변경하실 수 있을세요?