|
1.
|
|
|
Python Statements
|
|
|
|
Python Statements
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/python.rst:5
|
|
2.
|
|
|
Ren'Py is written in the Python programming language, and includes support for including python code inside Ren'Py scripts. Python support can be used for many things, from setting a flag to creating new displayables. This chapter covers ways in which Ren'Py scripts can directly invoke Python code, through the various python statements.
|
|
|
|
Ren'Py is written in the Python programming language, and includes support for including python code inside Ren'Py scripts. Python support can be used for many things, from setting a flag to creating new displayables. This chapter covers ways in which Ren'Py scripts can directly invoke Python code, through the various python statements.
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/python.rst:7
|
|
3.
|
|
|
Python
|
|
|
|
Python
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/python.rst:17
|
|
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::
|
|
|
|
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::
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/python.rst:19
|
|
5.
|
|
|
Python statements can get more complex, when necessary::
|
|
|
|
Python statements can get more complex, when necessary::
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/python.rst:26
|
|
6.
|
|
|
There are two modifiers to the python statement that change its behavior:
|
|
|
|
There are two modifiers to the python statement that change its behaviour:
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/python.rst:33
|
|
7.
|
|
|
``hide``
|
|
|
|
``hide``
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
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.
|
|
|
|
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.
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
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.
|
|
|
|
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.
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/python.rst:42
|
|
10.
|
|
|
``in``
|
|
|
|
``in``
|
|
Translated and reviewed by
Stephan Woidowski
|
|
|
|
Located in
../../source/python.rst:46
|