[Tutor] Need help printing a pickled data

Marc Tompkins marc.tompkins at gmail.com
Wed Jun 26 03:25:17 CEST 2013


On Tue, Jun 25, 2013 at 6:12 PM, Steven D'Aprano <steve at pearwood.info>wrote:


> Why do you want to see rubbish like that inside your log file? Surely
> something like this is better?
>
> log.write("data = %r" % data)
>
> which will give you a line like this:
>
> data = {'a': None, 'b': 42}
>
>
> in your log, which is a million times more understandable than a pickle.
>

This conversation is starting to remind me of Arlo Guthrie's Motorcycle
Song...
http://www.youtube.com/watch?v=BvLtNBm1yyA

"I don't want a pickle
I just wanna ride on my motorcycle..."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130625/bc20290a/attachment-0001.html>


More information about the Tutor mailing list