⬅︎ Back to To readline() or readlines()
Actually, the two are not quite the same. readlines() will return newlines on the end of your strings, while readline() will not.
>>> f.readline()'\x1b[0;35m .vir. d$b\n'>>> f.readlines()['\x1b[0;35m .d$$$$$$b. .cd$$b. .d$$b. d$$$$$$$$$$$b .d$$b. .d$$b.\n', (cut) ]Notice how both end in \n.
Comment
Actually, the two are not quite the same. readlines() will return newlines on the end of your strings, while readline() will not.
Replies
>>> f.readline()
'\x1b[0;35m .vir. d$b\n'
>>> f.readlines()
['\x1b[0;35m .d$$$$$$b. .cd$$b. .d$$b. d$$$$$$$$$$$b .d$$b. .d$$b.\n', (cut) ]
Notice how both end in \n.