[Zope] Help with unconsistent behavior of parameter passing to Python Scripts.

febb fb@piensa.com
Thu, 11 Apr 2002 23:57:19 -0500


Hello all:

Having the following Python script:

if same_type(RR,[]):
    return "It is a list"
if same_type(RR,'abcd'):
    return "it is a string"


If I use on the parameter's list (sme scrren where the Python script is edited) the value:

RR=[['04-03-2001','0900','MEX','PBA','0300','N'],['04-03-2001','1100','MTY','NLD','0300','N'],['04-03-2001','1600','NLD','MTY','0300','N']]

and proceed to TEST the script with the test tab, I am asked for the value of RR (two fields), if I give nothing, then the message

"It is a list" is printed, as expected.

But, if the same thing, (except the initial RR=) is fed into the values field at the test page, then the result comes as a "string", which is NOT the intended effect.

This is just a brief test to find out what is going on, the goal is to be able to feed into a Python script, a list of lists that the script will process
  and output another list of lists. We have been unable to obtain this as the scripts always ends getting a string instead of the wanted list (of lists).

Can anyone be so kind to explain the behavior of this ? And, to provide some samples on how to make this work correctly ?

By the way, we started with a perfectly working *.py program file , converting it into a script which behave on a similar way to the test just shown.

Thanks in advance for your help.

Edward.
Piensa Tech.