开发者

Any python "compiler" that can statically link the python2x.dll dependency?

开发者 https://www.devze.com 2022-12-11 00:55 出处:网络
It\'s my understanding that py2exe can only dynamically link a python2x.dll file.Are there any Python \"compilers\" out开发者_JAVA技巧 there that can package it all into one standalone .exe file for e

It's my understanding that py2exe can only dynamically link a python2x.dll file. Are there any Python "compilers" out开发者_JAVA技巧 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!


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.


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.


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消