|
4.
|
|
|
The python statement takes a block of python code, and runs that code when control reaches the statement. A basic python statement can be very simple::
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/python.rst:19
|
|
5.
|
|
|
Python statements can get more complex, when necessary::
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/python.rst:26
|
|
6.
|
|
|
There are two modifiers to the python statement that change its behavior:
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/python.rst:33
|
|
7.
|
|
|
``hide``
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/python.rst:36
|
|
8.
|
|
|
If given the hide modifier, the python statement will run the code in an anonymous scope. The scope will be lost when the python block terminates.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/python.rst:38
|
|
9.
|
|
|
This allows python code to use temporary variables that can't be saved - but it means that the store needs to be accessed as fields on the store object, rather than directly.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/python.rst:42
|
|
10.
|
|
|
``in``
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/python.rst:46
|
|
11.
|
|
|
The ``in`` modifier takes a name. Instead of executing in the default store, the python code will execute in the store that name.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/python.rst:48
|
|
12.
|
|
|
One-line Python Statement
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/python.rst:54
|
|
13.
|
|
|
A common case is to have a single line of python that runs in the default store. For example, a python one-liner can be used to initialize or update a flag. To make writing python one-liners more convenient, there is the one-line python statement.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/python.rst:56
|