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.
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.
Read the wiki here. Also read CONTRIBUTING.md
.
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!
The config.py
file contains some more configuration options.
Each of them is nicely explained, so why not just check it out?
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Δ | π·π΄ |