469,592 Members | 1,670 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

output object fields into a file

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

Aug 14 '07 #1
1 943
On Aug 13, 6:17 pm, Alex <llu...@gmail.comwrote:
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

Aug 14 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.