[PyMOL] Expose PyMOL API

2011-11-22 Thread Martin Hediger
Dear PyMOL List It comes up once in a while, is it possible to use PyMOL features from outside of PyMOL? An example, the below is a script (inspired by Thomas Holder) which saves down to disk all amino acids of a protein structure into separate PDB files. #

Re: [PyMOL] Expose PyMOL API

2011-11-22 Thread Thomas Holder
Hi Martin, the recommended way is to use PyMOL as your python interpreter, so instead of: python file.py do this: pymol -cqr file.py However, launching a PyMOL process from a python terminal as you suggested is also possible. Have a look at Example 2 of

Re: [PyMOL] Expose PyMOL API

2011-11-22 Thread Thomas Holder
Hi Martin, I don't have a Mac so I can't test this, sorry. I suspect that the _cmd module is built into the MacPyMOL executable. This would imply that you cannot use MacPyMOL like in the Launching_From_a_Script examples. Maybe someone of the MacPyMOL users knows more? Cheers, Thomas

Re: [PyMOL] Expose PyMOL API

2011-11-22 Thread Jason Vertrees
Martin, The _cmd module is indeed statically linked into MacPyMOL. But, if you built from open-source it's dumped into site-packages/pymol. Also, view the files inside pymol/examples/launching. There are plenty of examples. If you're using a pre-built package from elsewhere, then please contact

Re: [PyMOL] Expose PyMOL API

2011-11-22 Thread Martin Hediger
Thanks for the answers. I'll be trying to get it compile on a linux box, if I could access some of the PyMOL features there, that's fine as well. A friend tried to compile PyMOL on Mac and had quite some trouble, so I'll be first trying the Linux option. Martin Am 22.11.11 15:56, schrieb