就像著名的 BeautifulSoup 包一样,我想知道是否有标准方法可以将包转换为独立的 py 文件或文件?
问问题
88 次
3 回答
1
这应该可以解决问题。它会将包作为存档下载到目录中:
mkdir BeautifulSoup
pip install BeautifulSoup -d BeautifulSoup/
或者简单地说:
sudo pip install -t . BeautifulSoup
将在当前目录下载并安装Beautiful soup。
于 2013-07-03T13:50:29.127 回答
1
I do not know if there is a standard way / some module to do it , but you can pretty much do it by first installing the package using pip and then you can find the .py file/files at lib/python2.7/site-packages location.
于 2013-07-03T13:36:50.037 回答
0
一个 Python 包,只要不使用编译扩展,基本上就是一个目录结构中的一组文件,所以只需下载源包,找到包含 Python 脚本的目录,然后放在你想要的地方。
“构建”/“安装”的事情(在纯 Python 包的情况下)只是将 Python 脚本放在 Python 路径的某个位置。
于 2013-07-03T13:50:21.443 回答