Hello,
There are two different ways you can define blocks (regardless of the language you're generating).
2) You can define them using
JSON
Then you must separately create a
block-code generator for the block. In your case it should generate Python.
If you want to create dictionaries, sets, and tuples, you will probably also want to add
mutators to your blocks, so that the blocks can have a variable number of inputs. But you can always save that bit for later hehe.
All of your blocks should either be defined inside of <script> tags in your html page, or included in a separate .js file, which you import using a <script> tag. You may also want to check out the
getting started codelab if this is your first time using blockly.
I hope that helps! If you have any further questions please reply!
--Beka