I have a text file which I need to store in a list.

**FILE:**

```
1 1
4 2
9 10

```

I would like to have a list of objects.
`L = [obj obj obj]`

**CODE:**

```
def putInList(pathToFile):
     myList = []
     with open(pathToFile) as f:
         for line in f:
             s = line.split()
             x, y = [int(v) for v in s]
             jemand = Mensch(x, y)
             myList.append(jemand)
     return myList

```

This works fine!
My problem is that I access **DISK MEMORY** the number of lines times!

And this sample is artificial I will be working with much bigger files. So I wrote a slicer that puts them into `~100MB` `.txt` files. So I would like to put them in a `list` without accessing the `disk memory` million of times.

After search and other questions on StackOverFlow I found this piece of code:

```
a = open(fileToPath, 'r')
L = [line for line in a.readlines()]

```

But I have no clue to how to parse a list ?