pprint and ">>>"

Shu-Hsien Sheu sheu at bu.edu
Wed Sep 24 19:21:45 CEST 2003


Sometimes, it is find of nice using:
print >> my_file_object, my_variabels
than using the standard f.write.
However, it cannot be done with pprint.pprint.
I understand that i can do it by redirecting the sys.stdout, but isn't 
it nice if I can do something like pprint.pprint >> my_file_object, 

BTW, the syntax
print >> my_file_object, my_variables
seems a bit awkward to me.
Isn't it better if we can simply use:
print *whatever_this_is >> my _file_object
just like the way we do in unix shell?


More information about the Python-list mailing list