We need py2exe to crawl through our main application,  and bundle all of the imports, but not bundle the main application itself.

If I excluded the main application, would it still crawl through the application and load all of the imports?

On Mon, Aug 8, 2011 at 9:51 PM, Mark Hammond <mhammond@skippinet.com.au> wrote:
On 9/08/2011 11:46 AM, Adam Estes wrote:
I changed optimize to 0 in my setup.py file and it fixed the not being
able to import .pyc.

When it compiles the .exe, it bundles our main application as well as
the pre_loader.

The pre_loader downloads the main application file (programmanager.pyc)
and then imports and it and initates run on it. If we compile the
preloader without the .py file for the main application, it fails at
running the application after it imports it.

Is there a way that we can remove the .py file when we run our
preloader, so the only existing version is the one outside of the
compiled .exe?

The above isn't clear to me - a working example is best - but it sounds like you want the 'exclude' option which is listed in the docs.

Also, be sure you delete the 'build' and 'dist' directories between trying various things, as stuff from an earlier build may still wound up being included.