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()
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()