Juergen Huber wrote: ... > here is the print command, which delivers me the following output (see > below) on the shell: > print '%-30s | %-12d | %-12d |%-12d ' % (typename, > size / count, > count, > size) ... > Is there a way to put this output in an file?!?!
Another way nobody has yet mentioned: import sys old_output, sys.stdout = sys.stdout, open('somefile.txt', 'w') try: <<<put call to original code here>>> finally: old_output, sys.stdout = sys.stdout, old_output old_output.close() print 'Output safely written to:', old_output.name --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list