Python tethered programs from Blockly emulator

If you are not confident with programming in Python or you have a CodeBug Blockly project you want to use in tethered mode, you can generate tethered Python from Blockly code.

On the create page, drag blocks to create a repeating scrolling message program in Blockly and then test it with the emulator. Now click the Python tab just above the Blockly workspace.

Left-click and drag the highlighter box around all of the Python code and then right-click and select Copy.

Now open a text editor (such as Notepad, Leafpad, TextEdit or IDLE) and Right-click and paste the code into the blank document. Save this as "codebug-tether-test.py" in your home directory.

Open a Terminal and type:

python3 codebug-tether-test.py

You will see your message scrolling on your tethered CodeBug. In your Terminal window, hold Ctrl C to stop the program.


Activities with this step

Back to top