Python: converting arg1=some_value arg2="a text string" to list
by rnturn from LinuxQuestions.org on (#5MCH7)
The subject line pretty much sums it up. I have numerous atrings similar to the above that I am trying to convert to a list like:
Code:[ 'arg1=some_value', 'arg2=a text string' ]I've found tons of examples using split that produce things like:
Code:[ 'arg1=some_value', 'arg2=a', 'text', 'string' ]which isn't what I'm looking for---the quoted strings are the problem.
Ideas?
TIA...
Code:[ 'arg1=some_value', 'arg2=a text string' ]I've found tons of examples using split that produce things like:
Code:[ 'arg1=some_value', 'arg2=a', 'text', 'string' ]which isn't what I'm looking for---the quoted strings are the problem.
Ideas?
TIA...