On 3 Jan 2006 17:42:44 -0800, "KraftDiner" <[EMAIL PROTECTED]> wrote:
>I'm porting a routing from C++ to python.
>There is a complex for loop that I don't know how to code in python
>
>for (i = nPoints-1, j = 0; j < nPoints; i = j, j++)
>
Perhaps most directly comparable semantics (untested):
i = nPoints-1
j = 0
while j<nPoints:
# whatever body code
i = j
j += 1
Not sure what i is really for, but j seems to be independent,
so perhaps (also untested, and caveat: it's past bedtime)
i = nPoints - 1
for j in xrange(nPoints):
# whatever
i = j
Regards,
Bengt Richter
--
http://mail.python.org/mailman/listinfo/python-list