Message326791
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? |
|
Date |
User |
Action |
Args |
2018-10-01 10:42:44 | pashkasan | set | recipients:
+ pashkasan, rhettinger, ronaldoussoren |
2018-10-01 10:42:44 | pashkasan | set | messageid: <1538390564.66.0.545547206417.issue34859@psf.upfronthosting.co.za> |
2018-10-01 10:42:44 | pashkasan | link | issue34859 messages |
2018-10-01 10:42:44 | pashkasan | create | |
|