pybrainfuck
pybrainfuck is yet another Python BrainFuck implementation. The goal is not be the fastest or most efficient but rather to be extensive in the implementation, configurable and extendable.
It contains a BrainFck class which can be directly used or subclassed to use in scripts. The code is fully documented and commented.
Or else the pip installed script pybrainfuck can be directly used.
Documentation
Read the full documentation at readthedocs.org:
Python 2/3 Support
Python 2.7
Python 3.2/3.3/3.4/3.5
It also works with pypy and pypy3
Installation
From pypi:
pip install pybrainfuck
From source:
Place the pybrainfuck directory found in the sources inside your project and import it
Scriptwise:
The entire implementation has been kept inside a single file. You can copy it inside other sources too
Quick Usage
Let’s quickly put together a script:
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import sys
from pybrainfuck import BrainFck
if name == '__main__':
bfck = BrainFck()
for arg in sys.argv[1:]:
print('-' * 50)
print('Running:', arg)
print('-' * 50)
bfck.runfile(arg)
print()
And prepare a Hello World (including a newline) brainfuck program:
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
And both paired for a execution:
$ ./readme-example.py readme-example.b -------------------------------------------------- Running: readme-example.b -------------------------------------------------- Hello World!
Although the newlines after Hello World! are difficult to perceive.
Using the built-in script pybrainfuck:
$ pybrainfuck readme-example.b Hello World!
Which luckily produces the same result.
Metadata
Release files for pybrainfuck 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pybrainfuck-1.0.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Release files / pybrainfuck-1.0.1-py2.py3-none-any.whl
| Download URL | pybrainfuck-1.0.1-py2.py3-none-any.whl |
|---|---|
| Size | 13.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
698bc4de98b29b753a7f09841c3a8e3e972c24cb1f5f823915df0d1501bd9f5f
|
|
BLAKE2b-256 checksum How to use checksums |
5eb2dc24e40ebeb83b49f05c885d581d4efa5853db5f0b6dd789f9137f169302
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pybrainfuck 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.