[Zope] Learning Python Syntax for Zope Objects and DTML Operations

dman dman@dman.ddts.net
Mon, 6 May 2002 09:48:30 -0500


--FL5UXtIhxfXey3p5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, May 05, 2002 at 02:52:27PM -0700, Dan Shafer wrote:
=20
| At 10:14 PM 5/5/2002 +0200, Dieter Maurer wrote:
=20
| >Please look into the Python Language Reference (or an elementary
| >Python book) for "for" to learn about iteration in Python.
|=20
| I knew I had to use a "for" construct, the problem was creating the rest =
of=20
| the line, as you have done here. Is this syntax *always* consistent?

Yes.

| I.e.,=20
| is it always context.someDTMLfunction(['list of', 'string arguments'])?

Only if that function call yields the sequence of objects you want to
iterate over.  If you want to iterate a certain number of times, then
your loop will look like

    for i in range( 10 ) :
        print i

The key to determining what to put between 'in' and ':' is to
determine what sequence of objects you want to iterate over.

-D

--=20

 "Piracy is not a technological issue. It's a behavior issue."  =20
                                                       --Steve Jobs
=20
GnuPG key : http://dman.ddts.net/~dman/public_key.gpg


--FL5UXtIhxfXey3p5
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAjzWl74ACgkQO8l8XBKTpRSMvACfflc9O2H38OGh2PZVGPsCRtYH
CBsAnAlzyhwneHimsjI9h+fDexYo7eHk
=aM5z
-----END PGP SIGNATURE-----

--FL5UXtIhxfXey3p5--