Secret-chest / scratch2python

Scratch2Python allows you to run Scratch projects in Python

Home Page:https://Secret-chest.github.io/s2p

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scratch2Python

GitHub GitHub issues GitHub pull requests GitHub milestones GitHub forks GitHub all releases

All Contributors

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.

๐Ÿ“ Requirements and installation

๐Ÿ“ฅ 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.

โ–ถ๏ธ Setting the project

Now that you have downloaded Scratch2Python, let's run a project.

Using test mode

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.)

GUI (experimental)

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.

๐Ÿ“– Wiki

Our GitHub Wiki may have some outdated information and it is short, but still useful.

๐Ÿง‘โ€๐Ÿ’ป Contributors

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

About

Scratch2Python allows you to run Scratch projects in Python

https://Secret-chest.github.io/s2p

License:GNU General Public License v3.0


Languages

Language:Python 100.0%