A few beginning questions

richardc richardc at hmgcc.gov.uk
Tue Jul 15 10:38:15 CEST 2003


Thanks for all the replies,

I think I'll use optik for the argument parsing, its very close to a C++
library I wrote to do the same job.  Although my 10 second scan of the docs
didnt reveal exactly what the 'store' param dose ?

As for 'convention' based 'enforcement', not so shure about that as a
programming paradime, perhaps thats the C++ programmer in me :) but if its
the way to do it ... so be it.

Im guessing from the lack of responce that there arnt many python editors
which run on OSX.

As you all seem so helpful I'll ask a couple of other questions.

1. How do tyou do enum's in python, infact dose anybody know of a C++ ->
Python crossreference doc out there ?

2. Is there a reason that the python documentation is ... dont know how to
describe it really.  Ive used PHP and their documentation and its great,
particually the 'user comments' bit.  But for some reason python's seems a
little 'obscure'.  I mean doing things like searching for 'for', I want  a
simple description and some examples showing me the use of range in a for
loop, and answering how to reverse iterate through a list.  Instead I get
the formal syntax for the 'for' command.  Not really that useful.

3. How do I reverse iterate through a loop ... is there an easier way than
something like the following
    l = ['some', 'text', 'in', 'a', 'list' ]
    for i in range( 0, len( l ) ):
        do something to l[ i ]

4. Is there an easy way to reverse read a file ?  I mean like a 'getline'
that works by reading backwards through the file.  Im guessing getting
single characters and moving the file pointer back is going to be slow in
python. Its not actally that important... just wondering

Many thanks

Rich








More information about the Python-list mailing list