
Python Logo interpreter with frontend made in Svelte.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
This project is created for the Innovative Projects by Nokia subject on UWR studies. It features a Logo language interpreter, a Flask backend and a Svelte frontend.
- Logo parser using Lark.
- Custom interpreter for Logo commands.
- Frontend made in Svelte.
To get a local copy up and running, follow these simple steps.
Make sure you have the following installed:
- Python: Version 3.10 or higher
- Node.js (optional, for web application): Version 18 or higher
- Poetry (optional): For dependency management
You can install the project in two ways: using pip
or poetry
.
-
Clone the repository:
git clone https://github.com/YarynaRachkevych1/python-logo.git cd python-logo
-
Create a virtual environment:
python -m venv venv source venv/bin/activate
-
Install the project with dependencies:
pip install .
-
Clone the repository:
git clone https://github.com/YarynaRachkevych1/python-logo.git cd python-logo
-
Install the project with dependencies:
poetry install
You can use the project in two ways: as a Python module or as a web application. For more information about the frontend, see the frontend/README.md file.
import python_logo
sample_code = "fd 10 bk 20"
# Generate commands to execute them one by one.
logo_runner = python_logo.run(sample_code)
for command in logo_runner:
print(command)
# {'command': 'forward', 'value': 10}
# {'command': 'backward', 'value': 20}
# Or get them all at once.
logo_runner = python_logo.run(sample_code)
commands = list(logo_runner)
print(commands)
# [{'command': 'forward', 'value': 10}, {'command': 'backward', 'value': 20}]
-
Build the frontend:
npm install --prefix frontend/ npm run build --prefix frontend/
-
Run the application:
python app.py # Using pip poetry run python app.py # Using Poetry
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
Before commiting, please ensure you've installed pre-commit hooks:
pre-commit install
pre-commit install --hook-type commit-msg
Distributed under the MIT License. See LICENSE for more information.