There is a problem with .json file, which contains cyrillic symbols. How to convert CP1251 to UTF-8? (temp_data.decode('utf-8') has no effect, such as ensure_ascii=False in .dumps)
import json
def load_data(filepath):
with open(filepath, 'r') as f:
temp_data = json.load(f)
return temp_data
def pretty_print_json(d):
out_json = json.dumps(d, sort_keys=True, indent=4, separators = (',', ': '))
print(out_json)
if __name__ == '__main__':
print("Enter the path to .json file: ")
in_path = input()
print("There are pretty printed json format: ")
pretty_print_json(load_data(in_path))