views:

154

answers:

4

It's my understanding that py2exe can only dynamically link a python2x.dll file. Are there any Python "compilers" out there that can package it all into one standalone .exe file for easier portability?

If so or if not, which is the best compiler z0mg!

A: 

py2exe can package it all in single executable, without needing any python installation on target system, it may include python2x.dll with it, but for the end user how does it matter

Anurag Uniyal
A: 

From what I understand, it is possible to statically link python into an executable, but then you lose your ability to load other dynamic modules (.pyd files) like os and zlib and math. Unless you are able to statically compile those as well into your main program.

And as far as I know, the only compiler that can do this is the C compiler that is compiling python from source. :)

I'm not sure its worth the effort at all. Better just use p2exe and create a directory of files that can be zipped and shipped.

HS
A: 

PyInstaller claims to be able to create a single-executable that's user-friendly. Perhaps that would meet your needs. I've never used it.

Jason R. Coombs
A: 

If you check the bottom of the py2exe SingleFileExecutable wiki page you'll see that it can create one-file executables. They do include the DLL inside, but you shouldn't notice that. I believe it works with a freakish hack that intercepts the LoadLibrary calls to allow them to read from elsewhere in the .exe file, but again you shouldn't notice that. We've used it before... it works.

Peter Hansen