elikaski / BF-it

A C-like language to Brainfuck compiler, written in Python
MIT License
120 stars 11 forks source link

Add an editor for BF-it #69

Open abhra2020-smart opened 3 years ago

abhra2020-smart commented 3 years ago

A basic editor for BF-it

Bugs: readchar() won't work (editor won't respond)

NeeEoo commented 3 years ago

It's better to not expect that python is named python for example for me it's called python3.8.

You might be able to call the functions directly.

abhra2020-smart commented 3 years ago

Does python3 also work?

NeeEoo commented 3 years ago

You can replace the interpreter command call with an import to that and using the function. Look in BF-it.py

NeeEoo commented 3 years ago

I wouldn't recommend renaming that file since the dash is part of the name

NeeEoo commented 3 years ago

I mean you should use

import Interpreter
from Compiler import Compiler

Compiler.compile(code)
# and
Interpreter.brainfuck(code)
abhra2020-smart commented 3 years ago

The command to run the BF file MUST be a command so subprocess.Popen() can run it

elikaski commented 3 years ago

Please import the interpreter function and use it, instead of calling subprocess. There is an example in BF-it.py