Extend

From PyMOLWiki
Revision as of 13:07, 17 February 2005 by Cmoad (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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