"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "examples/devel/extend_demo01.py" between
pymol-v1.8.6.0.tar.bz2 and pymol-v2.1.0.tar.bz2

About: PyMOL is a Python-enhanced molecular graphics tool. It excels at 3D visualization of proteins, small molecules, density, surfaces, and trajectories. It also includes molecular editing, ray tracing, and movies. Open Source version.

extend_demo01.py  (pymol-v1.8.6.0.tar.bz2):extend_demo01.py  (pymol-v2.1.0.tar.bz2)
# Python script extend_demo01.py # Python script extend_demo01.py
# A recipe for creating a new PyMOL command which calls your own PyMOL code # A recipe for creating a new PyMOL command which calls your own PyMOL code
from pymol import cmd from pymol import cmd
# step 1: define your Python function # step 1: define your Python function
def my_color(color="red",sele="name CA"): def my_color(color="red",sele="name CA"):
print "I am coloring "+color+ " all atoms in selection: "+sele print("I am coloring "+color+ " all atoms in selection: "+sele)
cmd.color(color, sele) cmd.color(color, sele)
# step 2: add you command to the PyMOL command language # step 2: add you command to the PyMOL command language
cmd.extend("my_color", my_color) cmd.extend("my_color", my_color)
# step 3: run this script from within PymOL # step 3: run this script from within PymOL
#PyMOL> run extend_demo01.py #PyMOL> run extend_demo01.py
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)