真正的path.py请站起来吗?

发布于 2024-09-27 04:05:47 字数 496 浏览 1 评论 0 原文

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

现在看来,原来的产物有多种衍生产物。到目前为止我可以找到 unipath,看起来像 分叉的path.py另一个,以及 PyPI 的其他一些内容。

有人对这些选项有经验吗?在功能、维护或任何其他标准方面,一个比另一个更好吗?或者我应该随机选择一个?

(对这个异想天开的标题表示歉意。我首先选择了“Which path.py?”,但它太短了,不符合SO的口味。)

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.

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?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

智商已欠费 2024-10-04 04:05:47

我也很长时间以来一直是这个模块的粉丝。 这个似乎有最新的提交,并且也忠实于原始内容形式——确实,我最喜欢我尝试过的不同版本。可使用 pip install path.py

edit 安装:看起来从 python 3.4 开始(并在 PYPI 上向后移植到 2.7),有一个名为 pathlib。它不像某些路径模块那么广泛,但它得益于没有混乱,并且它是一个经过深思熟虑的路径实现,保留了相当多路径库的一些最佳基本品质都在那里。特别值得注意的是,它干净地处理了不同操作系统路径(Windows 和 Posix)之间的差异,并且似乎是一个值得一看的良好干净工具。不管它是否拥有人们想要的所有功能(它没有),Python 终于拥有了一个良好的标准路径实现,这真是太好了。

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

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.

墨小墨 2024-10-04 04:05:47

所有path.py粉丝站起来!

从Python 3.4开始,模块正在处理路径, module pathlib< /代码>。它基于 PEP 428,并深受我们喜爱的 path.py 的启发,尽管似乎采取了一些不同的方法,特别是在 Windows 路径和 Unix 路径之间的强烈区别上。

All path.py fans stand up!

Since Python 3.4, a module is dealing with paths, module pathlib. It is based on PEP 428, and heavily inspired from our beloved path.py, though seems to take some different approach notably on a strong distinction between Windows path and Unix path.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文