On Tue, Mar 23, 2010 at 12:48 PM, hari jayaram <harijay@gmail.com> wrote:
I want to write a python/pymol  script that will give me residue -residue distances within a pdb file programmatically 

I know that within pymol I can get a distance object using

select r55 , chain A and resi 55
select r 22 , chain A and resi 22

distance (r55) ,(r22)

This creates the dist01 object . If I wanted to do this using a python script and get a pretty print of all the distances in the distance object , how do I do that?
Also pointers to other python toolkits that can allow me to make such measurements outside pymol will be greatly appreciated.

CCTBX will do this for sure - it supports a selection syntax very similar to PyMOL's.  It isn't particularly intuitive, however; if you're interested in using it, contact me offline and I can send you some examples.

There is also BioPython, which is written for bioinformatics rather than crystallography and appears to have a much simpler API (but will definitely read PDB files).