[Chicago] is there really no built-in file/iter split() thing?

Tim Ottinger tottinge at gmail.com
Mon Dec 3 18:55:54 CET 2007


Kumar McMillan wrote:
> On Dec 1, 2007 11:50 PM, Massimo Di Pierro <mdipierro at cs.depaul.edu> wrote:
>   
>> Try this
>>
>> import re, mmap
>> file=open(filename,'r')
>> mfile=mmap.mmap(file.fileno(),0,prot=mmap.PROT_READ)
>> items=re.compile('[^;]+').finditer(mfile)
>> for item in items: print item.group()
>>     
>
> nice!  I didn't know about mmap.
>
>   
Nicer yet! I knew about mmap, but didn't know about finditer!


More information about the Chicago mailing list