packet (script) |
Prev | Data File Format | Next |
Name
packet (script) — A script packet
Synopsis
Description
A script packet stores a Python script offering direct low-level access to the Regina calculation engine.
A script may contain variables representing other packets in the same
packet tree; these are described by the child var
elements.
The Python script itself is stored as a single text
element.
In older versions of Regina (4.95 and earlier) it was stored
line-by-line using a sequence of line
elements, but this
method of storage was deprecated when the text
element
was introduced in Regina 4.96.
If you are writing a file that must be read by older versions of
Regina then you may write the script twice,
first as a series of line
elements (for Regina 4.95 and
earlier), and then as a single text
element (for Regina 4.96
and later).
Warning
If you are writing both line
and text
elements, then
the order is important.. This is because when
Regina reads a line
element it will append the line to the script,
but when it reads a text
element it will simply replace the
entire script. Therefore, if the line
elements appear
after the text
element, Regina will
construct two copies of the script end-on-end.
The roles played by the child tag
and packet
elements are
described in the general packet
element documentation.
Prev | Contents | Next |
packet (PDF) | Up | packet (SnapPea triangulation) |