Tell me, please, why in the code below, the results inside the cycle are returned in Cyrillic, and after the cycle already in a different encoding?
# -*- coding: utf-8 -*- import os path_f = [] for d, dirs, files in os.walk(u'd:\удалить'): for f in files: path = os.path.join(d,f) path_f.append(path) print(path) print(path_f)` result
d:\удалить\реестр1.xlsx d:\удалить\реестр2.xlsx [u'd:\\\u0443\u0434\u0430\u043b\u0438\u0442\u044c\\\u0440\u0435\u0435\u0441\u0442\u04401.xlsx', u'd:\\\u0443\u0434\u0430\u043b\u0438\u0442\u044c\\\u0440\u0435\u0435\u0441\u0442\u04402.xlsx']
[u'String']- jfs