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-if判断 2026-11-02 Python-运算 2026-11-02 Python模块-sys模块