how to see what content have by object? & write its content to separe file?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how to see what content have by object? & write its content to separe file?

sagarnikam123
want to see what is inside cn object & write its content line by line in .txt file

>>> cn
<Bio.PDB.HSExposure.ExposureCN object at 0x03469590>
>>>for x in cn:
          print(x)
gives output

(<Residue SER het=  resseq=60 icode= >, 38)
(<Residue ARG het=  resseq=61 icode= >, 32)
(<Residue TRP het=  resseq=62 icode= >, 36)
(<Residue TRP het=  resseq=63 icode= >, 42)
Reply | Threaded
Open this post in threaded view
|

Re: how to see what content have by object? & write its content to separe file?

Tim Roberts
sagarnikam123 wrote:
> want to see what is inside cn object & write its content line by line in .txt
> file

Well, that's basically what your code is currently doing.  The "cn"
object appears to be an iterator, returning a list of tuples one by
one.  If you want the results formatted in a pretty way, then you need
to know more about the "Residue" object in the tuples it is returning.
We don't know anything about those objects -- you'll have to find that
in the code or its documentation.

--
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-win32