I need help with importing a file and converting each line into a list.
An example of the file would look like:
p wfgh 1111 11111 111111 287 48 0 656
If you want all of the values in a flat list, the code would look as follows:
ls=[] for line in open( "input.txt", "r" ).readlines(): for value in line.split( ' ' ): ls.append( value )
If you just want the lines in a list then you can stop at readlines().