6.3.7. Logging commands

class pyspex.log.Log[source]

Class to save and execute commands and output from the terminal.

Variables:
  • do_output (bool) – Parameter indicating whether log output is on.

  • do_save (bool) – Parameter indicating whether log save commands is on.

close(logtype)[source]

Close the save or output file.

Parameters:

logtype (str) – String indicating the type of log to close (‘save’ or ‘out’).

execute(filename)[source]

Execute commands listed in an ascii file with a .com extension.

Parameters:

filename (str) – Filename of the ASCII file with the SPEX commands (including .com extension).

Return type:

int

output(outfile, status=None)[source]

Save the terminal output to ascii file. The status is optional and either overwrite or append.

Parameters:
  • outfile (str) – Filename of the output file (including .out extension).

  • status (str) – (Optional) Overwrite or append an existing file name. String can be ‘overwrite’ or ‘append’.

save(savefile, status=None)[source]

Save the commands for a session in an ascii file. The status is optional and either overwrite or append.

Parameters:
  • savefile (str) – Filename of the output command file (including .com extension).

  • status (str) – (Optional) Overwrite or append an existing file name. String can be ‘overwrite’ or ‘append’.