[Tutor] Re: Naive Questions
Michael Powe
michael@trollope.org
Tue Dec 3 01:58:02 2002
On Sun, Dec 01, 2002 at 08:38:23PM -0500, Derrick 'dman' Hudson wrote:
> On Sun, Dec 01, 2002 at 04:17:00PM -0800, Michael Powe wrote:
> | hello,
> |
> | a couple questions to which i haven't been able to find answers.
> |
> | i don't seem to find a python equivalent to the "rewind" file operation
> | in C -- that is, i read through a file and i want to go back to the
> | beginning and read again. is the only option to close & reopen?
>
> What C function are you thinking of? The only ones I know of are
> ftell(3) and fseek(3). Python file objects have both.
>
> http://python.org/doc/current/lib/lib.html
>
> | and just from curiosity, why are there no increment/decrement operators,
> | and nothing equivalent to += & its friends? i'd have thought this
> | would be a faq, but don't find anything about it there.
>
> | the second, just that i'm lazy & find having to always type out i =
> | i+1 annoying. ;-)
>
> You're not the only one :-).
thank goodness! it's lonely out there!
>
> http://www.python.org/peps/pep-0203.html
>
> As of python 2.0. The pep also explains why '++' isn't included (but
> '+=1' isn't any worse, really).
thanks. i didn't see mention of the increment operator but it's good to know
that the others are there.
mp