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


i have following code:

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

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

pprint.pprint(dataobject, logfile) 

see the documentation


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -