Calling Python scripts from Spectra

SPECTRA> python file.py [arg1 [arg2 ...]]

The sys.argv array passes the command line arguments to the script. Information can be transferred in the opposite direction by symbol definitions:

#!/usr/bin/env python

import Spectra
import sys
#
# put cursor to the upper left corner
#
print "\033[1;1f"
#
# print param1, param2, ...
#
print " args ", sys.argv
#
result = 1.2345
cmd = "return_value = %g" % result
Spectra.gra_command( cmd)