Warning

You are reading the documentation related to the development version. Go here if you are looking for the documentation of the stable release.

spectrochempy.Script

class Script(name='unamed_script', content=None, parent=None, priority=50.0, **kwargs)[source]

Executable scripts.

The scripts are used in a project.

Parameters
  • name (str) – Name of the script. The name should be unique.

  • content (str) – Content of sthe script.

  • parent (instance of Project) – Parent project.

  • priority (int, optional, default: 50) – priority.

See also

Project

Object containing NDDataset’s, sub-Project‘s and Script.

Examples

Make a script

>>> s = "set_loglevel(INFO)"
>>> s = "info_('Hello')"
>>> myscript = scp.Script("print_hello_info", s)

Execute a script

>>> scp.run_script(myscript)

Examples using spectrochempy.Script

Project creation

Project creation