Suggestion: str.itersplit()

Alex Martelli aleax at mac.com
Sat Apr 21 23:57:30 CEST 2007


Dustan <DustanGroups at gmail.com> wrote:

> On Apr 21, 7:58 am, Dustan <DustanGro... at gmail.com> wrote:
> > >From my searches here, there is no equivalent to java's
> >
> > StringTokenizer in python, which seems like a real shame to me.
> >
> > However, str.split() works just as well, except for the fact that it
> > creates it all at one go. I suggest an itersplit be introduced for
> > lazy evaluation, if you don't want to take up recourses, and it could
> > be used just like java's StringTokenizer.
> >
> > Comments?
> 
> If anybody could inform me on how to get my hands on the python source
> code, I might even be able to come up with an example of how it could
> be implemented. I have no idea how to unzip that tgz or tar.bz2 file
> on a windows machine, though (and that's not from lack of trying).

Top search hit for
    windows tar
is <http://gnuwin32.sourceforge.net/packages/tar.htm> , but its contents
suggest using <http://gnuwin32.sourceforge.net/packages/bsdtar.htm>
instead (it has "the ability to direcly create and manipulate .tar,
.tar.gz, tar.bz2, .zip, .gz and .bz2 archives, understands the most-used
options of GNU Tar, and is also much faster; for most purposes it is to
be preferred to GNU Tar", to quote).


Alex



More information about the Python-list mailing list