Search code examples
pythoncx-freeze

cx_Freeze python single file?


I've been using cx_Freeze for a while now and there is one thing I've really wanted to do: put ALL files into ONE executable that I can distribute. It's not really user-friendly to send around a folder filled with 30 files, all in the same directory. How can I accomplish this? Thanks.


Solution

  • Isn't this what bbfreeze does?

    Tutorial here: http://www.blog.pythonlibrary.org/2010/08/19/a-bbfreeze-tutorial-build-a-binary-series/

    It's actually not that hard to roll your own with Python zipimport http://docs.python.org/library/zipimport.html

    You may prefer to use something like UPX which is a more general solution, not Python only. http://upx.sourceforge.net/