I am working with the cmd class in python and it passes me all my arguments as one big line. What is the best way tokenize this arg string into an args [] array.
Example:
args = 'arg arg1 "arg2 with quotes" arg4 arg5=1'
result = split_args(args)
And it will look like this:
result = [
'arg',
'arg1',
'arg2 with quotes',
'arg4',
'arg5=1'
]
source
share