Scratch2Python is a Scratch project interpreter that runs Scratch projects in Python, using pygame to render your sprites. Go to #23 if you want to change the name.
Unlike others, Scratch2Python can actually display your projects, not only process the variables, control flow, math and logic in the project, and simply print speech bubble blocks.
It's not finished though. It only supports a few blocks, but it supports them well. The goal is to support almost everything (save for online services like text-to-speech) when we'll declare it as done. (Of course we'll still update things like the GUI.)
Scratch2Python is not yet a transpiler.
📥 Visit the website to easily download Scratch2Python
Then install from requirements.txt using:
pip install -r requirements.txt
Scratch2Python also needs Python 3.8 or newer. Click here to download Python for Windows and Mac. On recent GNU/Linux distros (Ubuntu 20.04+, Debian 11+, Linux Mint 20+, Fedora 32+, updated rolling-release distros), Python 3 is preinstalled or downloadable from the repositories. Check your distro's documentation for more info.
Getting errors on Windows?
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.
To unprotect the “Documents” folder, go to its Properties and uncheck the “Read-only” checkbox.
Now that you have downloaded Scratch2Python, let's run a project.
For now Scratch2Python is in test mode by default. That means it will always run the project
defined in the projectFileName
variable in config.py
. The variable can be a path, which will load the project there,
or a Scratch ID / URL, which will download and cache the specified online project. No support for downloading unshared
projects is provided! (The Scratch Team will implement access control, and it won't be possible anyway soon too.)
Change the testMode
variable to False
so Scratch2Python will open a GUI when started. For now this is a basic filechooser,
but we'll implement a proper full GUI soon.
Our GitHub Wiki may have some outdated information and it is short, but still useful.
Thanks to the people listed here for contributing to Scratch2Python! (emoji key):
Secret-chest 💻 📆 🎨 📖 🐛 🌍 🖋 |
tigercoding56 📖 🤔 |
superscratch444tre 💻 🐛 |
Melt 🐛 |
This project follows the all-contributors specification. Contributions of any kind welcome! Add your name here: #29