python striping results
I'm trying to do something pretty simple:
line = "name : bob"
k, v = line.lower().split(':')
k = k.strip()
v = v.strip()
Is there a way to combine this into one line? I've found myself writing this over and over when creating parsers, and sometimes it involves more than just two variables.
I know I can use regexp, but it's simple enough not to require it ...
+2
a source to share