"python exe" and "py plugins"

Ahmad Baitalmal ahmad at bitbuilder.com
Thu Nov 20 10:45:37 EST 2003


Thomas Heller wrote:
>>That works fine in linux or uncompiled on windows, but with py2exe, it
>>can't find the "services" folder.
> 
> 
> You should be a bit more specific here - what do you mean by "it can't
> find the services folder" ?
> 
I figured out that's what is happening. py2exe used to package my 
"services" package because it was imported normally. But now I do a 
folder lookup to find all subfolders in my sys.executable + '/services' 
folder and
exec("import %s" % foldername )
each subfolder. That's why py2exe can't package those packages when its 
building.

And I'm doing it that way because the set of plugins are not known 
ofcourse, that's why I do this dynamic discovery at runtime.


This will work, but it feels a bit patchy to me, is there a way in 
python to say "here is the path to folder x, recursevily import all 
packages you find in there"? py, pyc, pyd also?

Thx,
ahmadster







More information about the Python-list mailing list