format_as_python_shell

Full name: ase2sprkkr.gui.shell.format_as_python_shell

ase2sprkkr.gui.shell.format_as_python_shell(code_str)[source]

Format Python code as it would appear in a Python shell. Prepend >>> to new statements and … to continuation lines.

Handles multi-line blocks like classes, functions, loops, and conditionals.

Parameters:

code_str (str)

Return type:

str