Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #58827

RE: chunking a long string?

From Nick Cash <nick.cash@npcinternational.com>
Subject RE: chunking a long string?
Date 2013-11-08 17:59 +0000
References <9258483E-76BD-4D96-8C46-7262A95E3ED4@panix.com>
Newsgroups comp.lang.python
Message-ID <mailman.2235.1383933591.18130.python-list@python.org> (permalink)

Show all headers | View raw


> I have a long string (several Mbytes).  I want to iterate over it in manageable chunks

This is a weirdly common question. See http://stackoverflow.com/questions/312443/how-do-you-split-a-list-into-evenly-sized-chunks-in-python for several solutions.

It's been proposed to be added to itertools before, but rejected: https://mail.python.org/pipermail/python-ideas/2012-July/015671.html and http://bugs.python.org/issue13095 

- Nick Cash 

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

RE: chunking a long string? Nick Cash <nick.cash@npcinternational.com> - 2013-11-08 17:59 +0000

csiph-web