[Pythonmac-SIG] Creating an applet that includes wxPython

Kevin Ollivier kevino at tulane.edu
Sun Sep 7 19:11:20 EDT 2003


Hi,

On Saturday, September 6, 2003, at 09:52  PM, velosa at cinenet.net wrote:

> I have written a small Python application for managing family trees  
> that uses wxPython for the interface.  My goal is to make this  
> available to various members of my family tree so they can enter the  
> information they have.  I'm now trying to figure out how to make it  
> available to other people.  I am hoping that there is a way to extend  
> the results of MacPython applet tool to include the wxPython  
> libraries, but I don't know enough about how Mac packaging works to  
> know whether this is really possible.  I got my own environment  
> working by downloading MacPython and wxPython-mac and installing them.  
>  I'm hoping I can simply provide a single bundle to the other Mac  
> users.  Ideally I'd like them to be able to run it all off of a CD.   
> Is there a reasonable way to do this or do I have to separately  
> include MacPython and wxPython-mac with my little applet.

It can be done, and it is not that difficult. Bundlebuilder.py will do  
most of the work for you, and the only special thing you need to do is  
add the libwx_macd library and resource file in via the "libs" option  
(if you use opengl you will need to add that library as well). Here's a  
bundlebuilder script I use to build my wxPython application, hopefully  
it is mostly self-explanatory:

------------------------------------------------------------------------ 
------
import bundlebuilder, os

#I set this to make adding subfolders into the package easier
packageroot = "/Users/kevino/oss/eclass/eclass_builder"

myapp = bundlebuilder.AppBuilder(verbosity=1)
myapp.mainprogram = os.path.join(packageroot, "editor.py")
myapp.standalone = 1
myapp.name = "EClass.Builder"
myapp.includePackages.append("encodings")
myapp.includePackages.append("_xmlplus")
myapp.resources.append(os.path.join(packageroot, "about"))
myapp.resources.append(os.path.join(packageroot, "autorun"))
myapp.resources.append(os.path.join(packageroot, "Graphics"))
#... add other necessary folders/files...

myapp.libs.append("/usr/local/lib/libwx_macd-2.4.0.dylib")
myapp.libs.append("/usr/local/lib/libwx_macd-2.4.0.rsrc")

myapp.setup()
myapp.build()
------------------------------------------------------------------------ 
--------

HTH!

Kevin




More information about the Pythonmac-SIG mailing list