472,128 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,128 software developers and data experts.

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 971
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.

Similar topics

reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.