Python文件操作-with open GodOne 2026-11-02 Python , Python> 文件操作 3 with open 可以快捷的打开文件,并且不再需要手动关闭文件,简化了文件的操作 with open('/etc/password', mode='r') as fr: fr.readline() 推荐文章 2026-11-02 Python-函数 2026-11-02 Python-元组 2026-11-02 Python-range函数