Wrapping statements in Python in SPSS

alankrinsky at gmail.com alankrinsky at gmail.com
Fri Dec 28 11:43:33 EST 2012


Chris,

I tried placing in the format you suggested and received this error message:

END PROGRAM.
Traceback (most recent call last):
  File "<string>", line 396, in <module>
ValueError: incomplete format key



____________________

On Friday, December 28, 2012 11:10:10 AM UTC-5, Chris Angelico wrote:
> On Sat, Dec 29, 2012 at 3:01 AM, alan wrote: > I am working with Python looping in SPSS. What are the limits for the > > for var1, var2, var3 in zip(Variable1, Variable2, Variable3): > > statement in the Python looping function within SPSS? I am getting an error message, I presume because of wrapping or length. Imagine the above statement, but expanded, as I am working with more than 28 variables in this loop, and even making the names really short is making the statement too long. Is it impossible to wrap and make this work? I know there are ways to wrap strings, including lists of variables, but here I have a statement/function. At what point are you wrapping it? Can you show the wrapped form and the error message? As a general rule, you can safely wrap anything that's inside parentheses. for ( var1, var2, var3 ) in zip( Variable1, Variable2, Variable3 ): pass That may be a tad excessive, but you get the idea :) ChrisA




More information about the Python-list mailing list