获取没有(选定)电池的Python

Don*_*Don 5 python distribution

我非常喜欢Python的"包含电池"的哲学,但现在我必须执行只有核心功能和其他一些我想逐个选择的超薄安装.

是否可以仅使用选定的模块下载Python?

Chr*_* W. 3

正常安装 python。打开 python 解释器并导入一些你认为不需要的东西。

import io, optparse, tarfile
Run Code Online (Sandbox Code Playgroud)

那么str模块的表示就有它的路径在里面

>>> tarfile
<module 'tarfile' from '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/tarfile.py'>
Run Code Online (Sandbox Code Playgroud)

您可以直接进入并删除.py安装中不需要的任何文件。

显然这是危险的,因为你并不真正了解 Python 模块的内部依赖关系。