pashkasan <pa...@pmbox.biz> added the comment:
str2 = open('sample.txt', 'rU').read() if "\n" in str2: print ("\\n found") else: print ("\\n not found") if "\r" in str2: print ("\\r found") else: print ("\\r not found") if "\r\n" in str2: print ("\\r\\n found") else: print ("\\r\\n not found") print str2 output http://prntscr.com/l0sc11 strange that print() has \r\n do i have to open file in binary mode or something to have \r not stripped? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue34859> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com