Question: I have a text file in this format:

```
Item1       20  0   
Item2       10  1
Item3       5   0
Item4       15  1
Item5       25  1
Item6       30  0

```

How can I `.readlines()` in a way that it appends only "Item1" and "Item2"etc. to a list, and leaves the numbers and spaces out?

Answer: 
You could try the below,

```
l = []
with open('/path/to/the/file') as file:
    for line in file:
        l.append(line.split()[0])
print(l)

```

Through list\_comprehension.

```
print([line.split()[0] for line in open('/path/file')])

```
```
lines = []
with open("text.txt", 'r') as fin:
    lines = fin.readlines()

for line in lines:
    print line.split(" ")[0]

```