标签: python jupyter read-eval-print-loop
我们可以在Jupyter中从REPL返回值吗?
import code def console_exit(): raise SystemExit try: code.InteractiveConsole(locals={"exit": console_exit}).interact() except SystemExit: pass