python apply file line

Solutions on MaxInterview for python apply file line by the best coders in the world

showing results for - "python apply file line"
Addison
19 Sep 2016
1with open(filename) as f:
2    content = f.readlines()
3# you may also want to remove whitespace characters like `\n` at the end of each line
4content = [x.strip() for x in content] 
5
similar questions
queries leading to this page
python apply file line