Activities/Turtle Art: Difference between revisions
| Line 716: | Line 716: | ||
===Version 104 onwards=== | ===Version 104 onwards=== | ||
A number of | There are two ways to create Python blocks: by loading sample code provided with Turtle Art or by loading Python code the your Journal. | ||
====loading sample code==== | |||
A number of individual sample programs are provided. Clicking on the Load Python Block button on the Load/Save Toolbar [[File:Loadpythonsamples.jpg]] will invoke a file-selector dialog. Select the sample that you want and it will be both copied to the Journal and loaded into a Python block. | |||
[[File:Pythonsampleselector.jpg]] | [[File:Pythonsampleselector.jpg]] | ||
====loading code from the Journal==== | |||
Clicking on a Python block [[image:Pythoncodeblock.jpg |45px]] that has been dragged onto the canvas from the Extras palette will invoke an object-selector dialog. | |||
[[File:Pythonobjectselector.jpg]] | [[File:Pythonobjectselector.jpg]] | ||
Select the Python code that that you want and | Select the Python code that that you want and that code will be loaded into the selected block. | ||
You can't run a Python block by clicking on it, as that opens the object selector; instead attach the block to another one and click elsewhere on the stack you have created. | |||
Which ever way you create them, multiple Python blocks can have different code loaded in them. | |||
===Sample code=== | ===Sample code=== | ||