how to send the output of pprint module to a log file

Viewed 52910

I have the following code:

logFile=open('c:\\temp\\mylogfile'+'.txt', 'w')
pprint.pprint(dataobject)

how can i send the contents of dataobject to the log file on the pretty print format ?

3 Answers
Related