Python如何从.egg文件导入模块? [英] How does Python import modules from .egg files?
本文介绍了Python如何从.egg文件导入模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在这里打开__init__.pyc
?
>>> import stompservice
<module 'stompservice' from 'C:\Python25\lib\site-packages\stompservice-0.1.0-py2.5.egg\stompservice\__init__.pyc'>
我在C:\Python25\lib\site-packages\
中看到的只是.egg文件,但是包的内部文件在哪里?
All I see in C:\Python25\lib\site-packages\
is the .egg file, but where are the internal files of the package?
推荐答案
http://peak.telecommunity. com/DevCenter/PythonEggs
.egg文件只是重命名的zip文件.
.egg files are simply renamed zip files.
使用zip程序打开egg,或者只是将扩展名重命名为.zip,然后解压缩.
Open the egg with your zip program, or just rename the extension to .zip, and extract.
这篇关于Python如何从.egg文件导入模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文