Using an existing tcl/tk installation on windows...

Martin von Loewis loewis at informatik.hu-berlin.de
Tue Jan 29 06:33:52 EST 2002


viking_kiwi at yahoo.com writes:

> What is involved in pointing tkinter to the existing installation?

First, both installation need to have the same DLL name, ie. if Python
uses tcl83.dll, your installation should also have tcl83.dll;
tcl82.dll won't help (and vice versa).

I didn't try, but I think just removing the installation that came
with Python, and setting the environment variables TCL_LIBRARY and
TK_LIBRARY should do the trick.

> Are there going to be any version compatibility issues (ie if I
> upgrade my Tcl/Tk installation to 8.3.4 or 8.4, its 8.3.2 at the
> moment, same as came with python)

Updating to 8.3.4 should be fine; to update to 8.4, you need to
recompile _tkinter.pyd.

> The various bits and pieces for tkinter are scattered around the
> python install - in the DLLs, Lib, libs and tcl subdirectories.

You need to arrange things so that Windows will find the tcl DLL; by
adding them to the system directory, or into the PATH. If that is
done, you can remove the DLLs from the Python DLL directory. The Tcl
libraries are found by Tcl itself, using a different mechanism, hence
the different location.

> Finally, any pointers on calling up existing tcl/tk code (I have a
> fair bit of it) would be appreciated.

If you have a tkapp object (usually available through widget.tk), you
can just do tk.call('encoding','names') to invoke the command
'encoding'; likewise for any other command.

HTH,
Martin




More information about the Python-list mailing list