LMIConsole¶
- class lmi.shell.LMIConsole.LMIConsole(cwd_first_in_path=False)[source]¶
Class representing an interactive console.
- interpret(script_name, script_argv, locals=None, interactive=False)[source]¶
Interprets a specified script within additional provided locals. There are LMIConsole.DEFAULT_LOCALS present.
Parameters: - script_name (string) – script name
- script_argv (list) – script CLI arguments
- locals (dictionary) – dictionary with locals
- interactive (bool) – tells LMIShell, if the script should be treated as if it was run in interactive mode
Returns: exit code of the script
Return type: int
- save_history()[source]¶
Saves current history of commands into the history file. If the length of history exceeds a maximum history file length, the history will be truncated.