您可以通过iter()与哨兵结合迭代:
for block in iter(lambda: file_obj.read(4), ""): use(block)
上一篇 在Windows,Python 2.6上安装PygraphViz
下一篇 python中列表列表的集合
版权所有 (c)2021-2022 MSHXW.COM
ICP备案号:晋ICP备2021003244-6号