脑力翻译
brainf的Python项目详细描述
brain·f
又一个用python编写的Brainfuck解释器。
对于示例程序,请导航到esolangs wiki或here。
用法
直接作为shell脚本运行:
$ cat > file.b #!/usr/bin/env brainfuck.py ++++++++++[>++++++<-]>+++++. ^D $ chmod +x file.b $ ./file.b A
作为python脚本运行:
$ brainfuck.py /path/to/file.b
作为python模块运行:
$ python -m brainf /path/to/file.b
作为python可执行文件(pex)运行:
$ python brainf-linux.pex /path/to/file.b
有关详细信息,请参见技术documentation。
下载
源代码:
$ git clone https://github.com/bzaczynski/brainf.git
安装
在新的虚拟环境中:
$ pip install .
要卸载:
$ pip uninstall brainf
建筑
二元分布
要使用Docker和PEX构建二进制发行版,请执行以下步骤。
- 创建新的Docker图像。
$ docker build -t brainf:linux -f Dockerfile.linux .
- 运行临时容器从图像中提取.pex文件。
$ docker run --rm brainf:linux cat /root/brainf-1.0.0-linux.pex > brainf-linux.pex
文件
要生成sphinx文档:
$ pip install -r requirements-dev.txt
$ cd docs/
$ make clean html
发布
建议在PyPI上发布项目的方法是使用twine,因为它默认使用ssl。
- 确保绳线已安装:
$ pip install twine
- 创建源和二进制分布:
$ python setup.py sdist bdist_wheel
上传到python包索引。
测试PYPI:
$ twine upload --repository-url https://test.pypi.org/legacy/ dist/*
PYPI:
$ twine upload dist/*
许可证
这个项目是根据MIT License授权的。