1
2
3
4
5
6
7
* Another way to pass an argument to Python.

* Alternative to http://www.spsstools.net/Python/PassAnArgumentToPython.sps.
* Omit the following line if using the Production Facility.
define @param () "Coming from SPSS or even outside SPSS (using stats.com -symbols)" !enddefine.
datafile attribute attribute = argv(@param).
begin program.
 8
 9
10
import spssaux
arg = spssaux.getAttributesDict()["argv"]
print "--->", arg #This is just to check that Python got parameter as expected
11
end program.