I have the output of a command in tabular form. I\'m parsing this output from a result file and storing it in a string. Each element in one row is separated by one or more w
The str.split method will automatically remove all white space between items:
str.split
>>> str1 = "a b c d" >>> str1.split() ['a', 'b', 'c', 'd']
Docs are here: http://docs.python.org/library/stdtypes.html#str.split