inplace:Python中的就地文件处理

时间:2021-05-18 13:10:23
【文件属性】:
文件名称:inplace:Python中的就地文件处理
文件大小:23KB
文件格式:ZIP
更新时间:2021-05-18 13:10:23
python open redirection file io | | | in_place模块提供了一个InPlace类,用于“就地”读取和写入文件:您写入的数据最终与您读取的文件路径相同,并且in_place会为您处理临时文件的所有必要处理。 例如,给定文件somefile.txt : 'Twas brillig, and the slithy toves Did gyre and gimble in the wabe; All mimsy were the borogoves, And the mome raths outgrabe. 和程序disemvowel.py : import in_place with in_place.InPlace('somefile.txt') as fp: for line in fp: fp.write(''.join(c for c in line if c
【文件预览】:
inplace-master
----MANIFEST.in(116B)
----README.rst(8KB)
----.github()
--------workflows()
----src()
--------in_place.py(14KB)
----TODO.md(2KB)
----tox.ini(1KB)
----LICENSE(1KB)
----test()
--------test_io_methods.py(2KB)
--------test_nonstr_path.py(4KB)
--------test_in_place_util.py(1KB)
--------test_bytes.py(964B)
--------test_symlinks.py(3KB)
--------test_move_first.py(17KB)
--------test_deprecated.py(1KB)
--------test_errors.py(2KB)
--------test_py3.py(1KB)
--------test_encoding.py(2KB)
--------test_general.py(16KB)
----setup.cfg(1KB)
----.gitignore(115B)
----pyproject.toml(118B)
----CHANGELOG.md(2KB)

网友评论