By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,097 Members | 1,529 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,097 IT Pros & Developers. It's quick & easy.

output object fields into a file

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.