Creating IronPython scripts
Importing external modules
The search path for importing py modules can be extended in the script itself, for example:
Example:
#Import external module import sys |
Importing and using ScriptoMate Types
Example:
#ScriptoMate types #VSApi is loaded and referenced by default, but still all required types need to be imported #from VSApi import * #Other types import clr |
Accessing Host objects
Please refer to the Scripting Host Object Model
Most common uses
#Set property #Call a sub routine Host.ScriptData.Variables.Remove("test") #Call a function err = Host.IsRunTimeError() #Create object varName = "test" #Datatable.RepeatScript #DR_TRX is the Datarow set by the repeater dr = Host.ScriptData.Variable["DR_TRX"].Value |
Misc.RunScript examples
Host Object |
Example file |
Host.ScriptData.Variables |
Xml\Tutorial\5001 Advanced topics\0401 Creating scripts\Python.Variables.xml |
Host.ScriptData.MailServers |
Xml\Tutorial\5001 Advanced topics\0401 Creating scripts\Python.MailServers.xml |
Host.ScriptData.FtpServers |
Xml\Tutorial\5001 Advanced topics\0401 Creating scripts\Python.FtpServers.xml |
Host.Progress |
Xml\Tutorial\5001 Advanced topics\0401 Creating scripts\Python.Progress.xml |
Host.DatasetManager |
Planned |
Host.AppManager |
Xml\Tutorial\5001 Advanced topics\0401 Creating scripts\Python.Application.xml |
Datatable.RepeatScript examples
Host Object |
Example file |
Host.ScriptData.Variables |
Xml\Tutorial\5001 Advanced topics\0401 Creating scripts\Datatable.RepeatScript.IronPython.xml |