0

I'm making a few Python applications for MacOSX (10.6 in this case, though I don't imagine it matters) using Tkinter to code the interface, and py2app to create the bundle.

As many of you know, these stand-alone apps tend to be a fairly large size, about 70-80 MB, mostly because I am using numpy. As expected, 23 MB of this is from numpy (which must remain uncompressed to function), but I found that 30 MB is from the Tcl framework at Contents/Frameworks/Tcl.framework, and 5 MB is from the Tk framework. For the hell of it I tried compressing both of these folders, which brought them down to 9 MB and 1 MB, respectively. Now the application is almost half its original size, and as far as I can tell everything is working perfectly.

My question is to the Tkinter/application gurus out there: Is this bad? Is there any reason that I shouldn't be compressing these frameworks? Could this impact distribution in any way? And if not, why doesn't py2app do this natively?

EDIT:

I tried actually removing both the Tcl and the Tk frameworks from my application bundle, and everything still works fine. Why are these here if they aren't used with tkinter?

Santosh Kumar
  • 26,475
  • 20
  • 67
  • 118
DaveTheScientist
  • 3,299
  • 25
  • 19

1 Answers1

1

It's probably continuing to work because it's using your frameworks to load Tkinter instead of the bundled ones. If you moved it to another computer without Tkinter, it might not launch or could just crash right away.

Kevin London
  • 4,628
  • 1
  • 21
  • 29
  • I was worried about that. However, there is also a Python.framework in the same folder, and if I compress that one the application doesn't launch, complaining about being unable to find a python runtime. If it was able to find my local Tcl/Tk installations, wouldn't it also find my local python runtime? – DaveTheScientist Aug 10 '12 at 17:50
  • Well, I tried it on another computer and you're absolutely right. Apparently the application was finding a local version of Tcl/Tk on my machine, as it wouldn't run on another machine. Once I unzipped the two frameworks, it worked fine. Cheers. – DaveTheScientist Aug 10 '12 at 19:30