标签:while print 文件 bsp with open 输出 dex open break
def myreadline(f, newline): buf = "" while True: while True: pos = buf.index(newline) yield buf[:pos] buf = buf[pos + len(newline)] chunk = f.read(4096) if not chunk: # 已读到结尾 yield buf break buf += chunk with open("input.txt") as f: for line in myreadline(f, "{|}": print (line)
标签:while print 文件 bsp with open 输出 dex open break
原文地址:https://www.cnblogs.com/sqtu/p/10568906.html