Consider the following code:
line = 'aaa bbb ccc' cols = line.split() print( cols )
The string split method chops up a string into a list of substrings by a delimiter string.
Here, we didn't pass a delimiter in the prior example, so it defaults to whitespace.
The following code splits the string at commas:
line = 'AAA,CCC,40' print( line.split(',') )
Delimiters can be longer than a single character, too:
line = "i'mTESTaTESTlumberjack" print( line.split("TEST") )