匹配行结尾字符串
'''
如果最后一行没有换行,即光标在最后一行末尾,而不是在下一行的开头
'''
f = open('imooc.txt')
for line in f:
if line.startswith('imooc') and (line.endswith('imooc\n')\
or line.endswith('imooc'))'''
如果最后一行没有换行,即光标在最后一行末尾,而不是在下一行的开头
'''
f = open('imooc.txt')
for line in f:
if line.startswith('imooc') and (line.endswith('imooc\n')\
or line.endswith('imooc'))2017-01-08
举报