1>>> D1={'1':1, '2':2, '3':3}
2>>> s=str(D1)
3>>> import ast
4>>> D2=ast.literal_eval(s)
5>>> D2
6{'1': 1, '2': 2, '3': 3}
7
8
1from pprint import pformat
2
3# Sufficiently large to make newline character in new format
4d = {"a": {'b': [1, 2, 3]}, "c": [4, 5], 'd': {'e': {'f': [6, 7, 8]},
5 'g': [9, 10]}, 'h': 11, 'i': 12}
6pformat(d)