开发者

Is there a python equivalent of ruby's "Pathname" module?

Ruby has this really handy modul开发者_StackOverflow中文版e called Pathname.

Is there a python equivalent to it?


pathlib is the answer to all your python path woos.

Example functionality:

from pathlib import Path
p = Path.cwd()

with (p/'somefile.txt').open() as f:
    f.read()

p.is_dir()


That looks a lot like os.path.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜