Skip to content
Back to top
View this page
Edit this page

# xonsh.execer

Implements the xonsh executer.

class xonsh.execer.Execer(filename='<xonsh-code>', debug_level=0, parser_args=None, scriptcache=True, cacheall=False)

  Executes xonsh code in a context.

  Parameters:
    filename str, optional

      File we are to execute.

    debug_level int, optional

      Debugging level to use in lexing and parsing.

    parser_args dict, optional

      Arguments to pass down to the parser.

    scriptcache bool, optional

      Whether or not to use a precompiled bytecode cache when execing code, default: True.

    cacheall bool, 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, compile_empty_tree=True)

    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)

    Evaluates (and returns) xonsh code.

  exec(input, mode='exec', glbs=None, locs=None, stacklevel=2, filename=None, transform=True)

    Execute xonsh code.

  parse(input, ctx, mode='exec', filename=None, transform=True, user_names=None)

    Parses xonsh code in a context-aware fashion. For context-free parsing, please use the Parser class directly or pass in transform=False.