although I am happy
with the speed I get, because I am learning python, I think I could do
it still a bit better. I think that the line for i in matriz[1:]:
could be improved with an iterator/generator, but I am not quite
certain how I should proceed.
I write this :-
for j, i in enumerate(matriz
First of all, as Steve Holden mentioned, do look at xlrd. It's
awesome.
Second, for your (a) question, if you want an iterator, that's quite
easy:
matriz = iter(matriz)
matriz.next() # Discard the first one
for i in matriz:
This technique works really well, especially if you have sub-loops.
Th
in practice be quite big, and although I am happy
> with the speed I get, because I am learning python, I think I could do
> it still a bit better. I think that the line for i in matriz[1:]:
> could be improved with an iterator/generator, but I am not quite
> certain how I should pro
with the speed I get, because I am learning python, I think I could do
it still a bit better. I think that the line for i in matriz[1:]:
could be improved with an iterator/generator, but I am not quite
certain how I should proceed.
b. the following lines could be improved by means of a
Duncan,
> If speed is an issue then it may be better to avoid the test altogether ...
>
Thanks for your suggestion.
Regards,
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
George Sakkis <[EMAIL PROTECTED]> wrote:
> On Apr 28, 10:10 pm, [EMAIL PROTECTED] wrote:
>> George,
>>
>> > Is there an elegant way to unget a line when reading from a
>> > file/stream
> iterator/generator?
>>
>> http://aspn.activestate.com/A
On Apr 28, 10:10 pm, [EMAIL PROTECTED] wrote:
> George,
>
> > Is there an elegant way to unget a line when reading from a file/stream
> > iterator/generator?
>
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/502304
>
> That's exactly what I was lookin
George,
> Is there an elegant way to unget a line when reading from a file/stream
> iterator/generator?
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/502304
That's exactly what I was looking for!
For those following this thread, the above recipe creates a generic
object
On Apr 28, 2:07 pm, [EMAIL PROTECTED] wrote:
> Is there an elegant way to unget a line when reading from a file/stream
> iterator/generator?
>
> By "unget" I mean a way to push back a line into the source stream and
> backtrack the iterator/generator one step?
>
> Th
[EMAIL PROTECTED] writes:
> Is there an elegant way to unget a line when reading from a file/stream
> iterator/generator?
>
> By "unget" I mean a way to push back a line into the source stream and
> backtrack the iterator/generator one step?
>
> The only alternat
Is there an elegant way to unget a line when reading from a file/stream
iterator/generator?
By "unget" I mean a way to push back a line into the source stream and
backtrack the iterator/generator one step?
The only alternative I can see is to put my line reading in a while-True
loop
11 matches
Mail list logo