"python exe" and "py plugins"

Thomas Heller theller at python.net
Thu Nov 20 14:54:23 EST 2003


Ahmad Baitalmal <ahmad at bitbuilder.com> writes:

> 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?

No, but it's easy to do that yourself.

Thomas




More information about the Python-list mailing list