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
p = open('filename')
#List:
linelist = [line for line in p.readlines()]
"""
But I prefer creating a dictionary as I find them more useful at times. Example here is very trivial. You can use the list index as a line number also.
"""
#Dictionary:
linedict = dict([(no, line) for no, line in enumerate(p.readlines())])