read stripped lines from a file python

Solutions on MaxInterview for read stripped lines from a file python by the best coders in the world

showing results for - "read stripped lines from a file python"
Yanis
10 Jun 2018
1with open('file.txt') as f:    lines = [ line.strip() for line in f ]
2
3# Takes approx. 0.10 of a second with a file
4# that has 479k single words, each on a new line.
similar questions
queries leading to this page
read stripped lines from a file python