Das Erwachen

Bioinformatics

"Python looks to me like the illegitimate spawn of C and BASIC, but then I used to program in 6502 machine code so what do I know ..." (Laurence Pearl, PyMOL user)

 
 

Tips for PyMOL from the PyMOL mailing list

Disclaimer: All the contributions displayed on this page were made by subscribers of the PyMOL mailing list at sourceforge.net and Warren L. DeLano himself. Although i have checked most of the things listed here, i cannot guarantee that everythings works well. I cannot even guarantee that i have understood everything written on this page. Please be cautious.

Kristian Rother

Available Subtopics:


Launching PyMOL

 
 

File for startup commands

Linux:
Whenever PyMol starts, a '.pymolrc' file containing commands is run. All you need to do is create ".pymolrc" and place it in your home directory. Alternatively, you can instead create ".pymolrc.py" which contains actual Python code instead of just PyMOL commands.

Windows:
On Windows, use 'pymolrc', 'pymolrc.py' or 'pymolrc.pym'.

Warren DeLano


 

Launching PyMOL from an external program

If PYMOL_PATH, LD_LIBRARY_PATH, and TCL_LIBRARY are correctly defined, then you can launch PyMOL from an external Python program as shown in examples/devel/start_pymol.py.

NOTE: This approach is not recommended, since the PyMOL launching process is subject to change without warning. The recommended approach is to just use PyMOL as your python interpreter:

pymol -r <script.py>
pymol -qcr <script.py>

Warren DeLano


 

Running PyMOL in batch mode

To perform PyMOL commands from stdin (file, pipe) without opening an OpenGL window, try:

pymol -qc


 

Suppressing PyMOL output

Just type:

feedback disable,all,actions
feedback disable,all,results
-From Python:
cmd.feedback("disable","all","actions")
cmd.feedback("disable","all","results")
Will suppress most of PyMOL's normal chatter.


 

Launching Python programs

Running a Python script from PyMOL, usually the command:

run script.py
Is enough. Of course, the file script.py needs to be in the working directory.
For more detailed examples, see the commands to launch Python scripts when starting PyMOL. Asynchronous means, that a new Python thread is started:
pymol example.py     # synchronous, in PyMOL module
pymol -r example.py  # synchronous in __main__ module
pymol -l example.py  # asychronous in a new module
You can also launch python programs from within PyMOL with the commands:
run example.py        # synchronous in pymol module
run example.py,main   # synchronous in __main__ module

spawn example.py        # asychronous in a new module
spawn example.py,global # asychronous in the PyMOL module
spawn example.py,main   # asychronous in the __main__ module

 
Rubor : http://www.rubor.de
Post an Kristian Rother: kristian.rother@charite.de

Last modified: Wed Apr 28 07:24:35 CEST 2004