It is required to parse vk by the given parameters and write the result to a file in Python 3.5.
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','a') while index != (count_index - offset_index): result.write(str(search_result[index + 1])) result.write('\n') index += 1 result.close() I get the error:
Traceback (most recent call last): File "E:***\vkscript.py", line 19, in <module> result.write(str(search_result[index + 1])) File "C:\Python\lib\encodings\cp1251.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\u039a' in position 16: character maps to <undefined>