Chimera Commands Index

runscript  script  script-arguments

Runscript allows executing a Python script with command-line arguments from within Chimera. The script file is specified by script, either a pathname to open the file directly or the word browse or browser to elicit a dialog for opening the file. The script runs in Chimera's current directory, which can be changed with the command cd (other files referenced in the script or its arguments can be specified by pathnames relative to that location or by absolute pathnames). Arguments that include spaces must be enclosed by quotes, but quotes should not be nested, with the exception that single quotes can appear inside a double-quoted string and double quotes can appear inside a single-quoted string.

The chimera module is pre-imported into the script's global namespace, and the arguments are made into a tuple variable in the global namespace called "arguments" containing however many strings were supplied. The arguments are also available in the standard sys.argv location.

The command open can also execute Python scripts, but it does not include a way of supplying command-line arguments.

See also: startup option --script, pdbrun