save'', clobber=False)

Save the current Sherpa session to a file.

  • filename (str, optional) – The name of the file to write the results to. The default is ‘’.

  • clobber (bool, optional) – This flag controls whether an existing file can be overwritten (True) or if it raises an exception (False, the default setting).


sherpa.utils.err.IOErr – If filename already exists and clobber is False.

See also


Clear all stored session data.


Load in a Sherpa session from a file.


Save the Sherpa session as an ASCII file.


The current Sherpa session is saved using the Python pickle module. The output is a binary file, which may not be portable between versions of Sherpa, but is platform independent, and contains all the data. This means that files created by save can be sent to collaborators to share results.


Save the current session to the file ‘’.

>>> save()

Save the current session to the file ‘bestfit.sherpa’, overwriting any existing version of the file.

>>> save('bestfit.sherpa', clobber=True)