Specify start and length, beside start and end, in slices

Noam Raphael noamr at correctme.users.sourcephorge.net
Wed May 26 16:45:43 EDT 2004


Fredrik Lundh wrote:
> Noam Raphael wrote:
> 
> 
>>I have to write:
>>picture[s2i(picture[10:14]):s2i(picture[10:14])+4]
>>I think this is nicer (and quicker):
>>picture[s2i(picture[10:>4]):>4]
> 
> 
> that's spelled
> 
>     picture = Image.open(file)
>     picture.getpixel((0, 0))
> 
> </F>
> 
> 
> 
> 
Hello,
Thanks for your suggestion, but I meant to give an example for the need 
of those slices when handling files of a format which is not already 
handled by a module someone wrote.
And what if I want to write a new module for handling images?

Noam Raphael



More information about the Python-list mailing list