Processing a large string

Dan Stromberg drsalists at gmail.com
Fri Aug 12 18:00:08 EDT 2011


This is the sort of thing I wrote bufsock for.  Don't let the name fool you
- although I originally wrote it for sockets,  it's since been extended to
work with files and file handles.

http://stromberg.dnsalias.org/~dstromberg/bufsock.html

It was recently modified to work on 2.x and 3.x.

On Thu, Aug 11, 2011 at 7:03 PM, goldtech <goldtech at worldpost.com> wrote:

> Hi,
>
> Say I have a very big string with a pattern like:
>
> akakksssk3dhdhdhdbddb3dkdkdkddk3dmdmdmd3dkdkdkdk3asnsn.....
>
> I want to split the sting into separate parts on the "3" and process
> each part separately. I might run into memory limitations if I use
> "split" and get a big array(?)  I wondered if there's a way I could
> read (stream?) the string from start to finish and read what's
> delimited by the "3" into a variable, process the smaller string
> variable then append/build a new string with the processed data?
>
> Would I loop it and read it char by char till a "3"...? Or?
>
> Thanks.
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110812/f04e633c/attachment-0001.html>


More information about the Python-list mailing list