Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #35704

Re: Wrapping statements in Python in SPSS

References <7fcd8949-c781-425c-b6d2-7d0a634b12b7@googlegroups.com>
Date 2012-12-29 03:10 +1100
Subject Re: Wrapping statements in Python in SPSS
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1397.1356711013.29569.python-list@python.org> (permalink)

Show all headers | View raw


On Sat, Dec 29, 2012 at 3:01 AM,  <alankrinsky@gmail.com> 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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Wrapping statements in Python in SPSS alankrinsky@gmail.com - 2012-12-28 08:01 -0800
  Re: Wrapping statements in Python in SPSS Chris Angelico <rosuav@gmail.com> - 2012-12-29 03:10 +1100
    Re: Wrapping statements in Python in SPSS alankrinsky@gmail.com - 2012-12-28 08:43 -0800
      Re: Wrapping statements in Python in SPSS Peter Otten <__peter__@web.de> - 2012-12-28 18:07 +0100
      Re: Wrapping statements in Python in SPSS Chris Angelico <rosuav@gmail.com> - 2012-12-29 04:12 +1100
        Re: Wrapping statements in Python in SPSS alankrinsky@gmail.com - 2012-12-28 09:33 -0800
          Re: Wrapping statements in Python in SPSS Mitya Sirenef <msirenef@lightbird.net> - 2012-12-28 12:55 -0500
          Re: Wrapping statements in Python in SPSS Mitya Sirenef <msirenef@lightbird.net> - 2012-12-28 13:05 -0500
          Re: Wrapping statements in Python in SPSS Mitya Sirenef <msirenef@lightbird.net> - 2012-12-28 13:20 -0500
        Re: Wrapping statements in Python in SPSS alankrinsky@gmail.com - 2012-12-28 09:33 -0800
    Re: Wrapping statements in Python in SPSS alankrinsky@gmail.com - 2012-12-28 08:43 -0800

csiph-web