Skip to content

bunpy repl

bunpy repl [flags]

Description

Opens an interactive Python REPL that uses the same goipy VM as bunpy run. All injected globals (fetch, URL, setTimeout, etc.) and bunpy.* modules are available without import.

Flags

FlagDescription
--quiet, -qSuppress the welcome banner
--help, -hPrint help

REPL commands

CommandDescription
:quit / :qExit the REPL
:helpShow REPL help

Examples

Start the REPL:

bunpy repl
# bunpy repl 0.9.1 (type :quit to exit)
# >>>

Evaluate expressions:

>>> 1 + 1
2
>>> import math
>>> math.pi
3.141592653589793

Use injected globals:

>>> resp = fetch("https://httpbin.org/get")
>>> resp.status_code
200

Pipe input (non-interactive mode - used in tests):

printf 'x = 1 + 1\nprint(x)\n:quit\n' | bunpy repl --quiet
# 2