Read a txt file in python 2.5

Viewed 1440

I want to read line by line a txt file and save it to a list, my python version is 2.5, but I get syntax error, can you help me? My code is as follows:

with open("test.txt") as f:
    content = f.read().splitlines()
1 Answers
Related