Python常見問題(7):Python圖形使用者介面 Graphic User Interface FAQ
Freeze is a tool to create stand-alone applications. When freezing Tkinter applications, the applications will not be truly stand-alone, as the application will still need the Tcl and Tk libraries.
One solution is to ship the application with the Tcl and Tk libraries, and point to them at run-time using the TCL_LIBRARY
and TK_LIBRARY
environment
variables.
To get truly stand-alone applications, the Tcl scripts that form the library have to be integrated into the application as well. One tool supporting that is SAM (stand-alone modules), which is part of the Tix distribution (http://tix.sourceforge.net/).
Build Tix with SAM enabled, perform the appropriate call to Tclsam_init()
,
etc. inside Python’s Modules/tkappinit.c
, and link with libtclsam and libtksam (you might include the Tix libraries
as well).