The tool’s interface below is still in French. The interface is being translated by Google Translate.
From blocks to Python and JavaScript
Paste a Scratch script: it is translated into Python or JavaScript, line by line, to show students that text code says the same thing.
Script Scratch
Code texte
Les déplacements du lutin deviennent des commandes du module turtle en Python. En JavaScript, ils sont notés comme des appels à un objet « lutin » à adapter à votre projet. Les blocs sans équivalent direct (sons, costumes, clones) apparaissent en commentaire.
How to use the blocks to Python and JavaScript converter
Translate a Scratch script into Python or JavaScript, line by line, to support the move to text code.
-
Paste the script
As block text, French or English.
-
Choose the language
Python or JavaScript.
-
Copy the code
Or download the file.
About the blocks to Python and JavaScript converter
Variables, loops, conditions, operators, questions and custom blocks have a direct equivalent. Sprite movements become commands of Python’s turtle module.
The code produced is runnable: the player’s input is converted to a number without error, as Scratch does.
Frequently asked questions about the blocks to Python and JavaScript converter
Are all blocks converted?
No: sounds, costumes and clones have no simple equivalent and appear as comments to adapt.
Where do I find the block text?
Write it as in the examples, one block per line, or paste a script shared in scratchblocks format.
Can I use these sheets in class?
Yes, freely and at no cost: the documents you generate are yours, with no account and no watermark.