0

I would like to write dictionaries with UTF-8 strings to a file. I saw another thread about printing utf-8 strings with pprint, and tried to modify the code seen there like this

MyPrettyPrinter().pprint(dict, stream=f)

but it is not working. I have no experience in classes in python, so I have no idea what to redefine in the pprint library.

Community
  • 1
  • 1
Rolf
  • 331
  • 4
  • 13
  • Sorry I somehow missed your link I can't see properly or the hyperlinks here aren't bright enough – jamylak Dec 25 '14 at 22:22

1 Answers1

0

It should be:

MyPrettyPrinter(stream=f).pprint(d)
jamylak
  • 128,818
  • 30
  • 231
  • 230