split parameter line with quotes
jkugler at bigfoot.com
Fri Jan 11 20:36:30 CET 2008
> first i'm a newbie to python (but i searched the Internet i swear).
> i'm looking for some way to split up a string into a list of pairs
> 'key=value'. This code should be able to handle this particular
> example string :
> i know i can do that with some regexp (i'm currently trying to learn
> that) but if there's some other way...
Take a look at the shlex module. You might be able to fiddle with the shlex
object and convince it to split on the commas. But, to be honest, that
above would be a lot easier to parse if the dividing commas were spaces
More information about the Python-list