Extract data from ASCII file

Ren rlpreston at sbec.com
Mon Feb 23 09:12:21 EST 2004


What is 'prefix' used for? I searched the docs and didn't come up with
anything that seemed appropriated.


"Mike C. Fletcher" <mcfletch at rogers.com> wrote in message news:<mailman.164.1077464239.27104.python-list at python.org>...
> With Python 2.3:
> 
>  >>> def splitter( line ):
> ...     line = line[9:] # skip prefix
> ...     while line:
> ...         prefix, line = line[:4],line[4:]
> ...         yield prefix[2:]+prefix[:2]
> ...
>  >>> for number in splitter( ':10000000E7280530AC00A530AD00AD0B0528AC0BE2'):
> ...     print number
> ...
...........snip...............
> _______________________________________
>   Mike C. Fletcher
>   Designer, VR Plumber, Coder
>   http://members.rogers.com/mcfletch/



More information about the Python-list mailing list