In Python, calling
temp = open(filename,\'r\').readlines()
results in a list in which each element is a line in the file. It\'s a little st
another example:
Reading file one row at the time. Removing unwanted chars with from end of the string str.rstrip(chars)
with open(filename, 'r') as fileobj: for row in fileobj: print( row.rstrip('\n') )
see also str.strip([chars]) and str.lstrip([chars])
str.strip([chars])
str.lstrip([chars])
(python >= 2.0)