Python标准库真的标准吗?

发布于 2024-09-24 19:37:23 字数 525 浏览 3 评论 0原文

Python 标准库是标准吗?如果安装了 Python,那么标准库也会安装吗?

文档读取

对于类 Unix 操作系统,Python 通常作为包的集合提供,因此可能需要使用操作系统提供的打包工具来获取部分或全部可选组件。

据我所知,标准库 index 仅将“可选操作系统服务”列为可选。

那么,如果安装了 Python,其他所有东西都可以在平台上使用吗?如果没有,那么在最常见的(Windows、Mac OS X、Linux)上可以期待什么?

PS:我正在给研究生讲授 Python 课程,我很乐意告诉他们 Python 总是附带电池的;这对于他们来说具有实际意义(当他们到达新实验室或使用新机器时,了解标准模块可用性方面的期望对他们很有用)。

Is the Python standard library standard in the sense that if Python is installed, then the standard library is installed too?

The documentation reads

For Unix-like operating systems Python is normally provided as a collection of packages, so it may be necessary to use the packaging tools provided with the operating system to obtain some or all of the optional components.

The standard library index only lists as optional the "Optional Operating System Services", as far as I can tell.

So, is everything else always available on a platform, if Python is installed? If not, what can be expected on the most common ones (Windows, Mac OS X, Linux)?

PS: I am teaching a Python class to graduate students, and I would love to be able to tell them that Python always comes with batteries included; this is of practical importance, for them (when they arrive in a new lab, or use a new machine, it is useful for them to know what to expect in terms of standard modules availability).

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

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

发布评论

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

评论(3

笑忘罢 2024-10-01 19:37:23

这不是Python的问题。您可以告知电池已包含在内。他们是。

这是不完整的分布。

我们对 Red Hat Enterprise Linux 拥有旧版本的 Python 感到不满意。然而,有升级的秘诀。

关闭所有开发人员包是一种常见的安全做法,从而使 Python 变得不完整。这是 Python 和基本 Linux 发行版之外的常见情况。

正常情况下包含电池。但是,剥离部分或全部电池也很容易。许多组织出于各种原因会创建不完整的库。

这不是Python。是环境不完整。

It's not a Python issue. You can teach that the batteries are included. They are.

It's the distributions that are incomplete.

We've been unhappy with the Red Hat Enterprise Linux having old versions of Python. However, there are recipes for upgrades.

It's a common security practice to turn off all developer packages, leaving Python incomplete. This is a common situation outside Python and outside the essential Linux distribution.

Batteries are included under normal circumstances. But, it's also very easy to strip some or all of the batteries. And many organizations will -- for a variety of reasons -- create incomplete libraries.

It's not Python. It's the environments that are incomplete.

微凉 2024-10-01 19:37:23

一般来说是的——可选部分中未列出的所有内容将始终可用。

以下是根据操作系统安装可能会有所不同的一些内容:
http://docs.python.org/library/someos.html

你可能不会'除非您正在进行相当高级的编程,否则不要使用它们。

Generally yes -- everything not listed in the optional section will always be available.

These are some of the things that may vary from OS to OS installation:
http://docs.python.org/library/someos.html

You probably won't use these unless you're doing fairly advanced programming.

一身仙ぐ女味 2024-10-01 19:37:23

这取决于发行版打包程序。例如,在 Debian 上,分析模块 profilecprofile 分别安装为 python-profiler。在不同的发行版上其他模块也可以像这样分开。

It depends on the distribution packager. For example on Debian the profiling modules profile and cprofile are installed separately as python-profiler. Other modules may be separated like this too on different distributions.

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