Difference between revisions of "Extend"

From PyMOLWiki
Jump to navigation Jump to search
m
 
Line 1: Line 1:
 
===DESCRIPTION===
 
===DESCRIPTION===
"extend" is an API-only function which binds a new external
+
'''extend''' is an API-only function which binds a new external function as a command into the PyMOL scripting language.
function as a command into the PyMOL scripting language.
 
  
 
===PYMOL API===
 
===PYMOL API===
Line 22: Line 21:
  
 
===NOTES===
 
===NOTES===
For security reasons, new PyMOL commands created using "extend" are
+
For security reasons, new PyMOL commands created using "extend" are not saved or restored in sessions.
not saved or restored in sessions.
 
  
 
===SEE ALSO===
 
===SEE ALSO===

Revision as of 15:09, 3 January 2006

DESCRIPTION

extend is an API-only function which binds a new external function as a command into the PyMOL scripting language.

PYMOL API

cmd.extend(string name,function function)

PYTHON EXAMPLE

def foo(moo=2): print moo
cmd.extend('foo',foo)

The following would now work within PyMOL:

PyMOL>foo
2
PyMOL>foo 3
3
PyMOL>foo moo=5
5
PyMOL>foo ?

Usage: foo [ moo ]

NOTES

For security reasons, new PyMOL commands created using "extend" are not saved or restored in sessions.

SEE ALSO

alias, api