I just started to learn python and I was wondering how to read a bunch of numbers from a txt file and put it into a sort of list. The txt file I want to read has three numbers next to each other with a space in between.
Like this:
24 39 45\n
I want to read this file into a list:
[24, 39, 45]
How can I do that? The .readlines() method doesn't seem to work as it turns the whole line into one single element: list[0] = ['24 39 45\n'].
Pardon me if this sounds like a stupid question. This is my first question here. Thank you!