Script Function

The $Script function allows users to run an external script as a data source. The function has two mandatory parameters:

  1. The full path and file name of the script interpreter.
  2. File path and name with the script without quoting.

Any number of optional parameters will be passed to the script. The column to column reference or expression call is acceptable.

The script should write generated data to standard output stream. One value per line.

Examples

  • $Script(c:\python33\python.exe,c:\my scripts\test.py) - Python script without extra parameters
  • $Script(c:\python33\python.exe,c:\my scripts\test.py,Data1,10) - Python script with two parameters: 'Data1' and '10'

Sample Python script

The script generates and returns squares between 1 and the first argument:

import sys

iter = 1+int(sys.argv[1])
for a in range(1,iter):
    print(a*a)