I have a text file which contains a matrix of numbers:
999 999 10 8 3 4 999 999 999 6 999 2 7 999 999 6 3 5 6 999 9 1 10 999 10 6 999 2 2 999
For each line, split on space character, and then convert each token to an int. One way to do this, using list comprehension, is:
s = "999 999 10 8" [int(t) for t in s.split(" ")] #evaluates to [999, 999, 10, 8]