Generic string import like in strptime?

Andre' John andre.john at s1999.tu-chemnitz.de
Wed Jan 16 18:07:14 CET 2008


Nice. Thanks a lot.

Andre


On Wed, 16 Jan 2008, Paul Hankin wrote:

> On Jan 16, 8:34 am, Andre <j... at hrz.tu-chemnitz.de> wrote:
> > Hi there
> >
> > Is there a function like strptime, which takes a string and converts it
> > into an array depending on a format string I provide. Like:>>> a = '3456\tblub-blib.0.9'
> > >>> b = '%d\t%s-%s.%f'
> > >>> c = mysticalfunction(a,b)
> > >>> print c
> >
> > [3456,'blub','blib',0.9]
> 
> Use regular expressions: see http://docs.python.org/lib/node49.html
> 
> --
> Paul Hankin
> 



More information about the Python-list mailing list