output object fields into a file

Zentrader zentraders at gmail.com
Tue Aug 14 04:27:15 CEST 2007


On Aug 13, 6:17 pm, Alex <llu... at gmail.com> wrote:
> Hello,  I am rather new to python.  Maybe my thinking is in the
> paradigm of C++, that makes me hard to make sense of some python
> scripts (interacting with C# code) written by my colleague.  I am
> thinking of outputting all objects and their fields of each script
> into a file.  The tricky part is I am NOT quite sure of the type of
> the fields.  How can I output these objects and their fields into an
> external file.  Any code sample would be highly appreciated !!!
>
> Alex

For now, assume that everything must be written as a string.  You can
use write or writelines depending on the type.
http://www.penzilla.net/tutorials/python/fileio/
http://docs.python.org/lib/bltin-file-objects.html




More information about the Python-list mailing list