Two questions

Richard Lewis richardlewis at fastmail.co.uk
Thu Jun 2 15:57:01 CEST 2005


On 2 Jun 2005 06:45:18 -0700, qscomputing at gmail.com said:
> Hi,
> 
> I've developed in several other languages and have recently found
> Python and I'm trying to use it in the shape of the PythonCard
> application development tool.
> 
> My two questions:
> 
> 1. What is the easiest way to create a for loop in the style I'm used
> to from Delphi ie:
> for I:=0 to 2 do begin
>   //code
> end;
> 
for i in range(0, 2):
    do stuff

The range([start], stop, [step]) function generates a sequence of
numbers which the the for loop iterates over.

(You can also use xrange() for a more memory efficient solution for very
large ranges).

> 2. Philospohy(sp?) aside, I could potentially want to create a
> binary-only distribution of my finished apps. I noticed the
> documentation on .pyc files: how do I create these and, aside from
> being basically read-only, are they used just like ordinary .py source
> files? And can they be easily reverse-engineered?
> 
To create binary only distributions for Windows you can use py2exe. Its
distributions files can be fairly easily reverse engineered.

Cheers,
Richard



More information about the Python-list mailing list