Codierungsproblem beim Schreiben in die Datei: UnicodeEncodeError: 'charmap' codec can't encode character '\u039a'
📁 Python
Es ist erforderlich, vk gemäß den angegebenen Parametern zu paaren und das Ergebnis in eine Datei mit Python 3.5 zu schreiben.
search_result = api.users.search(sort=sort_index, sex=sex_index, age_to=age_index, offset=offset_index, count=count_index, country=country)
result = open('result.txt', 'w')
while index != (count_index - offset_index):
result.write(str(search_result[index + 1]))
result.write('')
index += 1
result.close()
Ich erhalte einen Fehler:
UnicodeEncodeError: 'charmap' codec can't encode character '\u039a' in position ...: character maps to