I have a txt file with content in the form of lists like this:

```
[1,2,3,4]
[5,6,7,8]

```

I've put these lists into a list using the following code:

```
t = open('filename.txt', 'r+w')
contents = t.readlines()

alist = []

for i in contents:
    alist.append(i)

```

When I run

```
alist[0]

```

I get

```
[1,2,3,4]

```

but when I run

```
for a in alist:
    print a[0]

```

I get

```
[

```

instead of the fist value in the list.