[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Executable creation blues



Bob Ippolito wrote:

On 9/28/06, Jasper <jasper@xxxxxxxx> wrote:

Sami Hangaslammi wrote:

> I'd still like to hear why the original poster found PyPack
> unsuitable, (so that I could improve it), since it, for example, gets
> around both of the numpy/Numeric problems posted by Brian.

Partly because it apparently didn't like having an entry script
somewhere other than the root directory (although I didn't fiddle around
with this much so I could easily be missing something), but mostly
because I didn't think the method of tracing execution to find imports
was robust, in particular if you have dynamic imports.  In retrospect I
bet py2exe doesn't handle this either, so I'll give Pypack another try.


Your reasoning is totally backwards.

py2exe (and just about everything else) uses a less robust way of
tracking imports -- it examines bytecode, which will never find
dynamic imports. Tracing execution will generally find all imports, so
long as your code isn't pathologically dynamic.


In hindsight I see this, and posted that too quickly (I'm really itching to get this working).

IMHO you're wrong that code needs to be "pathologically dynamic" to use dynamic imports. I find it an entirely reasonable way to load dynamic code and content. I don't make much use of it now, but plan to as an easy means game modding.

That said, this should be encapsulated enough that it'd be easy to manually add. I'll give Pypack another try.

-Jasper