#1101

Support `monty -` to execute Python code from standard input

Openpygarapopened 9d ago

Problem

Unlike python, Monty's CLI does not support - as a positional argument to explicitly selects standard input.

Currently, monty /dev/stdin works, but monty - should also work, following the standard Python CLI convention without requiring a platform-specific path.

Proposed Solution

Treat - as standard input rather than a file path, executing the received Python code in script mode while preserving existing CLI options and behavior.

Usage

$ monty - <<'PY'
print('hello world')
PY
hello world

Activity

0

No activity yet.