views:

42

answers:

2

I'm trying to figure out which files in Python's (Python 2.6/Python 2.7) tcl folder are required in order to distribute frozen Python Tkinter apps using Py2exe or similar.

The quick and dirty way to do this (using pyexe as an example) is to follow the 2nd example on the following page and then xcopy your python's tcl folder to your dist folder (as a tcl sub-folder). http://www.py2exe.org/index.cgi/TixSetup

The problem with the xcopy tcl technique is that it copies 100's of extra files that may not be needed for distribution.

For example, my experiments show that the following tcl folders may(???) not be needed when freezing Python 2.7 Tkinter applications:

Note: The numeric sizes are the sum of all the files in each of these paths.

  • tcl\tcl8.5\encoding 1415K (delete non-applicable encodings? any needed for UTF-8/Unicode?)
  • tcl\tcl8.5\tzdata 1450K (timezone data for a tcl clock demo?)
  • tcl\tcl8.5*.tcl 256K
  • tcl\tix8.4.3\demos 246K
  • tcl\tk8.5\demos 685K

Am I on the right path or will not including the above tcl content bite me in the butt down the road?

Even better, is there some sort of documentation regarding the files in Python's tcl folder?

Thank you, Malcolm

+2  A: 

You don't need the demos (I hope; if you do, that's gross!) but everything else is potentially required; the encodings are used to convert between the outside world's bytes and Tcl's characters, and the tzdata is used to make the time processing work. You can trim the encodings and tzdata if you are delivering the app to a small target market – indeed, on Unix you might be able to leave out the whole of tzdata because the system will have an up-to-date version – but you should be aware that you are restricting the code's portability.

Donal Fellows
Thanks Donal. It looks like the demos are definitely not required. I think the encodings are also optional. I'm testing Unicode without the encodings folder and everything still works.
Malcolm
That depends on the OS too. I *think* you might be able to get rid of the encodings on Win and OSX as they are generally UNICODE platforms one way or another. Unix (esp. Linux) is a bit more variable IIRC, especially if using legacy fonts.
Donal Fellows
+2  A: 

Donal is right, of course. Your question is one that motivates at least several other people, though; if you'd like to pursue it more, I strongly recommend you check in with the Tkinter mailing list and associated Wiki.

Cameron Laird
+1 for the links
Donal Fellows
Appreciate the links as well.
Malcolm