brain·f
Yet another Brainfuck interpreter written in Python.
For sample programs navigate to esolangs wiki or here.
Usage
Run directly as a shell script:
$ cat > file.b
#!/usr/bin/env brainfuck.py
++++++++++[>++++++<-]>+++++.
^D
$ chmod +x file.b
$ ./file.b
A
Run as a Python script:
$ brainfuck.py /path/to/file.b
Run as a Python module:
$ python -m brainf /path/to/file.b
Run as a Python Executable (PEX):
$ python brainf-linux.pex /path/to/file.b
See technical documentation for more details.
Download
Source code:
$ git clone https://github.com/bzaczynski/brainf.git
Installation
In a new virtual environment:
$ pip install .
To uninstall:
$ pip uninstall brainf
Building
Binary Distribution
To build a binary distribution with Docker and PEX follow the steps below.
- Create a new Docker image.
$ docker build -t brainf:linux -f Dockerfile.linux .
- Run interim container to extract .pex file from the image.
$ docker run --rm brainf:linux cat /root/brainf-1.0.0-linux.pex > brainf-linux.pex
Documentation
To build Sphinx documentation:
$ pip install -r requirements-dev.txt
$ cd docs/
$ make clean html
Publishing
The recommended way to publish a project on PyPI is with twine since it uses SSL by default.
- Make sure twine is installed:
$ pip install twine
- Create source and binary distributions:
$ python setup.py sdist bdist_wheel
-
Upload to Python Package Index.
Test PyPI:
$ twine upload --repository-url https://test.pypi.org/legacy/ dist/*
PyPI:
$ twine upload dist/*
License
This project is licensed under the MIT License.
Metadata
Release files for brainf 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| brainf-0.0.1.tar.gz | 7.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| brainf-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.5 kB
Release files / brainf-0.0.1.tar.gz
| Download URL | brainf-0.0.1.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fdd0037554d20b1bbe78f0cd6edef69f9032338e5e3209d58a8c31881448d7a1
|
|
BLAKE2b-256 checksum How to use checksums |
ad2dd15f7c11e26d4c52ef2a90b134b46f468cf08fb88276cfdc8740b9c40ed8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3
|
Release files / brainf-0.0.1-py3-none-any.whl
| Download URL | brainf-0.0.1-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0b2b74ef850a81663e83c6f1d28c697fc3fe78efc2dbc39a676fd915a3897803
|
|
BLAKE2b-256 checksum How to use checksums |
54bbeb7ec5ed7432a7e644229913b04719ee39852cfb7052f53da2c7f8c76aab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3
|