Compilation, Evaluation, & Execution (xonsh.execer
)¶
Implements the xonsh executer.
-
class
xonsh.execer.
Execer
(filename='<xonsh-code>', debug_level=0, parser_args=None, unload=True, xonsh_ctx=None, scriptcache=True, cacheall=False)[source]¶ Executes xonsh code in a context.
- Parameters
- filenamestr, optional
File we are to execute.
- debug_levelint, optional
Debugging level to use in lexing and parsing.
- parser_argsdict, optional
Arguments to pass down to the parser.
- unloadbool, optional
Whether or not to unload xonsh builtins upon deletion.
- xonsh_ctxdict or None, optional
Xonsh xontext to load as builtins.__xonsh__.ctx
- scriptcachebool, optional
Whether or not to use a precompiled bytecode cache when execing code, default: True.
- cacheallbool, optional
Whether or not to cache all xonsh code, and not just files. If this is set to true, it will cache command line input too, default: False.
-
compile
(input, mode='exec', glbs=None, locs=None, stacklevel=2, filename=None, transform=True)[source]¶ Compiles xonsh code into a Python code object, which may then be execed or evaled.
-
eval
(input, glbs=None, locs=None, stacklevel=2, filename=None, transform=True)[source]¶ Evaluates (and returns) xonsh code.