Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Yet another Python brainfuck interpreter

Project description


PyPi Version PyPi Monthly Donwloads License Travis-ci Build Status Documentation Status Pytghon versions

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.


Read the full documentation at

Python 2/3 Support

  • Python 2.7
  • Python 3.2/3.3/3.4/3.5
  • It also works with pypy and pypy3


From pypi:

pip install pybrainfuck

From source:

  • Place the pybrainfuck directory found in the sources inside your project and import it


  • 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,

import sys

from pybrainfuck import BrainFck

if name == '__main__':

    bfck = BrainFck()

    for arg in sys.argv[1:]:
        print('-' * 50)
        print('Running:', arg)
        print('-' * 50)

And prepare a Hello World (including a newline) brainfuck program:


And both paired for a execution:

$ ./ 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.

Project details

Release history Release notifications

This version
History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pybrainfuck-1.0.1-py2.py3-none-any.whl (13.5 kB) Copy SHA256 hash SHA256 Wheel 2.7 Nov 16, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page