PyDocs

Nav

Custom Python Interpreters

compile_command

code

function (source)
  • compile_command(source, filename='<input>', symbol='single')
Compile a command and determine whether it is incomplete.

Arguments:

source -- the source string; may contain \n characters
filename -- optional filename from which source was read; default
            "<input>"
symbol -- optional grammar start symbol; "single" (default), "exec"
          or "eval"

Return value / exceptions raised:

- Return a code object if the command is complete and valid
- Return None if the command is incomplete
- Raise SyntaxError, ValueError or OverflowError if the command is a
  syntax error (OverflowError and ValueError can be produced by
  malformed literals).
0 Examples
No examples for code/compile_command.
See Also
No see-alsos for code/compile_command
0 Notes
No notes for compile_command