python readline remove newline code example
Example 1: stripping /n in a readlines for a pytgon file
alist = [line.rstrip() for line in open('filename.txt')]
Example 2: python remove new line
lines = ("line 1 \r\n")
lines.rstrip("\n\r")
alist = [line.rstrip() for line in open('filename.txt')]
lines = ("line 1 \r\n")
lines.rstrip("\n\r")