#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Location
    Albuquerque, New Mexico
    Posts
    137
    Rep Power
    11

    Freezing Python?


    Is there a way to freeze a python script into a bin (on Linux) including all of the dependancies? I've heard of cx-freeze but, google didn't pull up anything interesting.
  2. #2
  3. Mini me.
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Location
    Cambridge, UK
    Posts
    783
    Rep Power
    14
    Did you find this url:
    http://starship.python.net/crew/atuining/cx_Freeze/
    however, it is not a universal solution - you will need to do a package for each distro you will support. If you don't want to give out the source that will be difficult to maintain.

    A more universal solution is to distribute just the byte code (one package for each version of Python you will support). This is fine for Python/Tkinter and should be okay for wxPython.

    I built my own installer for Linux around some self extracting archive code but it might be better to use distutils bdist. There is a document on distributing using rpm in the Python Documentation
    Distributing Python Modules

    FYI this is what I did:
    Installed both Python 2.2 an 2.3
    For each version of Python...
    Created a distribution directory
    compiled the source code to .pyc files
    Deleted the .py files
    tarred the distribution directory
    joined the tar to a self extracting archive script.

    grim

IMN logo majestic logo threadwatch logo seochat tools logo