Difference between revisions of "Run"
Jump to navigation
Jump to search
Hongbo zhu (talk | contribs) |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
'''run''' executes an external Python script in a local name space, the global namespace, or in its own namespace (as a module). | '''run''' executes an external Python script in a local name space, the global namespace, or in its own namespace (as a module). | ||
Line 12: | Line 11: | ||
The default mode for run is '''global'''. | The default mode for run is '''global'''. | ||
− | Due to an | + | Due to an idiosyncrasy in Pickle, you can not pickle objects directly created at the main level in a script run as "module", (because the pickled object becomes dependent on that module). Workaround: delegate construction to an imported module. |
− | [[Category:Commands| | + | [[Category:Commands|Run]] |
Latest revision as of 02:56, 6 April 2011
run executes an external Python script in a local name space, the global namespace, or in its own namespace (as a module).
USAGE
run python-script [, (local | global | module | main | private ) ]
PYMOL API
Not directly available. Instead, use :
cmd.do("run ...").
NOTES
The default mode for run is global.
Due to an idiosyncrasy in Pickle, you can not pickle objects directly created at the main level in a script run as "module", (because the pickled object becomes dependent on that module). Workaround: delegate construction to an imported module.