How about using a python regex pattern?
import re
f = open('test.txt', 'r')
strings = re.findall(r"\S+", f.read())
And for your case of line.strip() will not work because Python removes only the leading and trailing characters
From Python Docs - Return a copy of the string with leading and trailing characters removed. If chars is omitted or None, whitespace characters are removed. If given and not None, chars must be a string; the characters in the string will be stripped from the both ends of the string this method is called on.