Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python read text file into a list

text_file = open("filename.dat", "r")
lines = text_file.readlines()
print lines
print len(lines)
text_file.close()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #read #text #file #list
ADD COMMENT
Topic
Name
1+5 =