Interscript has a third kind of section, the script section. In case you're wondering what script sections look like, well, you've already used them. All those lines starting with @ are just executable python script. They aren't really special magical commands, just function calls to predefined python functions.
You can write any python script you like in a script section. On-the-fly interscript for test 7 follows.
339: @name = 'John Skaller' 340: @print 'Hello',name 341: @print 'Running Python',sys.version 342: @head(1,'Hello World from '+name) 343: This is a scripting test. 344: @weave('Written by '+name+'.')
Notice you don't have to import sys: it is already imported, because it is used in Interscript. [Add list of imported modules here]
You will also notice the
@weave(text)command, which weaves its argument: use this when you want to calculate text, as in the example. For more information on the weave command, see Unknown Label:weave command.
You should be careful with this feature. It is immensely powerful!
You can use it to test programs, and to extend Interscript
for you needs in a
document -- without changing the actual source code for
http://www.python.org to find out more about python.
5.3.1. Long script sections
5.3.2. Very Long script sections