📜  pathlib 删除扩展 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:23.258000             🧑  作者: Mango

代码示例1
>>> from pathlib import Path

>>> filename = Path('/some/path/somefile.txt')

>>> filename_wo_ext = filename.with_suffix('')

>>> print(filename)
/some/path/somefile.txt

>>> print(filename_wo_ext)
/some/path/somefile