真正挣扎的东西应该是非常基本的。我正在寻找\ n没有倒数\ r的实例(即\ r \ n好x \ n不好并且会)。
我很欣赏这是因为python 2对rb的管理方式不同,但无法确定python 3中识别\ r的等效功能或方式。
import re
import sys
import time
with open('4 - raw.txt', 'rb') as content_file:
content = content_file.read()
newLinePos = [m.start() for m in re.finditer('\n', content)]
for line in newLinePos:
if (content[line-1]) != '\r':
print (repr(content[line-20:line]))
print ("end")
time.sleep(1000)
智慧大石
qq_笑_17
相关分类