Just an interjection -- not sure if this might help, but there is a capture function which will capture all printing. You can then write this to disk or do whatever you like with the capture text:
>>> def p(): # arg-less function that involves printing ... print 'hello world!' ... >>> s = capture(p) >>> print s hello world! -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
