⬅︎ Back to To readline() or readlines()
>>> 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.
Actually, the two are not quite the same. readlines() will return newlines on the end of your strings, while readline() will not.
Comment
>>> 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.
Parent comment
Actually, the two are not quite the same. readlines() will return newlines on the end of your strings, while readline() will not.