How are parameters passed to and from a python script

Discussion created by kenrus on Aug 17, 2012
Latest reply on Aug 17, 2012 by curtvprice
The basic question is: How are the different data types passed to, and returned from, a Python script that is ran from a toolbox?  It appears that, regardless of the data type selected, that only strings or numeric representations of the data types are actually passed to/from the script.  (When I add the script to a tool box the wizard asks for the input and output parameters.  There are several different types that appear to be non-text ... i.e. File ..., but from my reading and experimentation, it appears that all of these "types" are actually just filters that determine the format of the string that will be passed.)

I am asking this question because I have a requirement to develop a script (that will be made in to a geoprocessing service) that will return a PDF document to the calling code (Javascript).  Currently, the script creates a unique name for the PDF document, saves it to a known location and returns the full path and file name as a return parameter.  However, I have been asked to see if it is possible to write the PDF to memory and return that (however that can be done) to the caller.

Any help is appreciated.