This is a simple demo of generating Python code from JSON with no graphics. This might be useful for server-side code generation.

{ "blocks": { "languageVersion": 0, "blocks": [ { "type": "controls_if", "x": 20, "y": 20, "inline": false, "extraState": { "hasElse": true }, "inputs": { "IF0": { "block": { "type": "logic_compare", "fields": { "OP": "EQ" }, "inputs": { "A": { "block": { "type": "math_arithmetic", "fields": { "OP": "MULTIPLY" }, "inputs": { "A": { "block": { "type": "math_number", "fields": { "NUM": 6 } } }, "B": { "block": { "type": "math_number", "fields": { "NUM": 7 } } } } } }, "B": { "block": { "type": "math_number", "fields": { "NUM": 42 } } } } } }, "DO0": { "block": { "type": "text_print", "inline": false, "inputs": { "TEXT": { "block": { "type": "text", "fields": { "TEXT": "Don't panic" } } } } } }, "ELSE": { "block": { "type": "text_print", "inline": false, "inputs": { "TEXT": { "block": { "type": "text", "fields": { "TEXT": "Panic" } } } } } } } } ] } } |  |