Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

read stripped lines from a file python

with open('file.txt') as f:    lines = [ line.strip() for line in f ]

# Takes approx. 0.10 of a second with a file
# that has 479k single words, each on a new line.
Source by able.bio #
 
PREVIOUS NEXT
Tagged: #read #stripped #lines #file #python
ADD COMMENT
Topic
Name
2+3 =