Understanding what files in the TCL are required for distributing frozen Python Tkinter apps

徘徊边缘 提交于 2021-02-10 07:52:46

问题


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


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/3900375/understanding-what-files-in-the-tcl-are-required-for-distributing-frozen-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!