/scratch2python

Scratch2Python allows you to run Scratch projects in Python

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Logo

GitHub GitHub issues GitHub pull requests GitHub milestones GitHub forks

Scratch2Python

Scratch2Python is a Scratch project interpreter that runs Scratch projects in Python, using pygame to render your sprites.

A GUI for accessing the Scratch website is planned. It will most probably use... Qt. I would love using GTK, but WINDOWS... Or maybe not.

Scratch2Python may only be the temporary name, as this may get confused with Scratch2Py. See #23 for more information.

πŸ“ Requirements

Install from requirements.txt (Scratch2Python also needs Python 3.8 or newer).

On Windows, Scratch2Python needs to be installed in a non-protected folder. By default, the "Documents" folder is protected. Installing it anywhere else will work.

πŸ“˜ Docs

Read the wiki here. Also read CONTRIBUTING.md.

πŸ”¨ How to use

Assuming that you installed all necessary requirements, place your sb3 files somewhere accessible, or in the Scratch2Python folder. You can use an absolute or relative path. Then, go to config.py and change the projectFileName variable to your project file. There you can also choose to use a command-line argument, or an interactive prompt. The variable option is the default as it's more useful for testing.

Now, just run python3 main.py and the project will start!

βœ… Config

The config.py file contains some more configuration options.

Each of them is nicely explained, so why not just check it out?

🌐 Localization

To translate Scratch2Python, add a new file in the lang directory. Copy the English file for reference, and replace the string.

Then add it on the supported languages list both here and in config.py. Though I would not recommend translating it right now. It is still very WIP and you would have to update your language file very frequently.

Currently supported languages:

Language code Language name (English) Language name (translated) Flag
en English English πŸ‡¬πŸ‡§
ro Romanian limba romΓ’nΔƒ πŸ‡·πŸ‡΄