Try the updated, hosted version here: https://pyth-docker.azurewebsites.net/
See the docs: https://pyth.readthedocs.org/en/latest/
Pyth is an extremely concise language by isaacg1. This is a fork of isaacg1/pyth with the goal of providing a docker image running with an up-to-date Python version (currently 3.11) and dependencies.
Some example programs to run:
- Hello world:
"Hello, world!
- Add two numbers:
+1 1
- Add two inputs:
+Qvw
- Check if number is prime:
}QPQ
- Echo input as output:
z
Useful links:
- Esolang entry for Pyth
- Tips for golfing in Pyth
- Pyth practice
- Simple golfing problems
- Code golf challenges
- Code golf challenges on codidact
- Codeforces problemset
You can use the pre-built image directly: docker run -d --name pyth-docker -p 8000:8000 adrianus/pyth-docker
- Build image:
docker build --tag pyth-docker .
- Run:
docker run -d --name pyth-docker -p 8000:8000 pyth-docker
After that, open localhost:8000 in your browser to access it.
You can use Pyth directly from the command line: python3 pyth.py -c "+1 1"
You can also run the server + UI directly using Python/Flask, without gunicorn.
- First, install the requirements:
pip3 install -r requirements.txt
- Start it:
python3 server.py
- Then, visit localhost:5000
To run the test suite: python3 test.py