真正的path.py请站起来吗? [英] Will the real path.py please stand up?

查看:39
本文介绍了真正的path.py请站起来吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Jason Orendorff编写了一个很好的模块path.py.如果我没记错的话,有一些关于将其添加到标准库中的讨论,然后它就消失了.

There was a good module, path.py, written by Jason Orendorff. If I recall correctly, there was some discussion about adding it to the standard library then it faded away.

现在看来,原始结果有多个结果.到目前为止,我可以找到 unipath ,看起来像另一个,以及根据PyPI的其他一些信息.

It looks now that there are multiple outgrowths of the original one. I can find so far unipath, what looks like a forked path.py, another one, and a few others according to PyPI.

任何人都有使用这些选项的经验吗?在功能,维护或任何其他标准方面,一个比另一个好吗?还是我应该随机选择一个?

Anyone has experience with any of those options? Is one better than the other in terms of functionality, maintenance or any other criteria? Or should I just pick one at random?

(对这个异想天开的标题表示歉意.我首先去找"Which path.py?",但是对于SO的口味来说太短了.)

(Apologies for the whimsical title. I first went for "Which path.py?" but it was too short for SO's taste.)

推荐答案

我也很喜欢这个模块. 似乎具有最新提交,并且与原始提交相同表格-实际上,我最喜欢尝试过的不同版本.可使用pip install path.py

I've also been a fan of this module for quite some time. This one seems to have the most recent commits, and also to be true to the original form -- which really, I like best of the different versions I've tried. Installable using pip install path.py

编辑:从python 3.4开始(在PYPI上反向移植到2.7),有一个名为

edit: Looks like as of python 3.4 (and backported to 2.7 on PYPI), there's a standard lib path module called pathlib. It's not nearly as extensive as some of the path modules are, but it benefits from the lack of clutter, and it is a well-thought-out path implementation, retaining some of the best base qualities of quite a few of the path libraries that are out there. Particularly of note, it cleanly handles the differences between different OS paths (Windows and Posix), and seems like a good clean tool that's worth a look. Regardless of whether it has every feature one could ever want or not (it doesn't), it's nice that Python finally has a good standard path implementation.

这篇关于真正的path.py请站起来吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆