py2exe service and tool-tray app combined?

Thomas Heller theller at
Thu Aug 14 20:18:45 CEST 2003

Graham Fawcett <fawcett at> writes:

> Thomas Heller wrote:
>>If you discovered a bug in an .sll file, you could either buid and
>>distribute a new version of it, or you could create an additional, new
>>.sll file containing the fixed methods. And you would make sure to list
>>this new .sll in the myapp.bnd file, before the buggy one. This way the
>>size of the upgrade could be kept as small as possible.
>>Now, isn't this '.bnd' file mechanism also a nice idea for py2exe?
> "Nice idea" is an understatement, Thomas -- it would be heaven!
> Presumably the Python analog of the .sll file would have to contain
> new/corrected modules, rather than just new/corrected methods, unless
> you're one of those wild aspect-weaving types.
> And presumably there would be inspection mechanisms to allow for
> examination of the .bnd file, and provide an opportunity for fetching
> updates when the program boots...
> An installed app could "phone home" to an update-server, send nothing
> but a message digest of its .bnd file, fetch a new .bnd if the old one
> is stale, and pull down the missing-but-requisite .sll files... all
> before the __main__ module starts importing the app logic. That's cool.
> It would be nice, for long-running apps, if there were a facility for
> restarting the app automatically (under permitted conditions) if
> updated code were detected at the update server. Maybe just a runtime
> api for determining if the codebase is up to date, and then let the
> app make the decision whether to restart.

The .bnd file would trigger three actions: The first part is done
before Py_Initialize is called - setting the Python interpreter flags,
and preparing an initial PYTHONPATH. This would have to be done from C
code alone, so it must be trivial.

The second part would run after Py_Initialize has been called, and so it
could be implemented with Python code: downloading updated packages, and
preparing the final environment.

The third and final part would then probably run the script itself.

> All this could be done in the absence of py2exe, of course, but a
> standardized framework for this kind of thing would be ideal. It could
> complement PyPI and distutils as well, I would imagine.
> So, having swooned for a moment, let me ask: are you considering
> adding such a mechanism to the new py2exe?

Currently, I'm thinking about the possibilities.
And I'm trying to convince the relevant people to accept a patch for
Py_Main(), implementing all this and thus making it cross-platform.


More information about the Python-list mailing list