python-3.xtkintertix

What does 'root.tk.eval()' mean in python, in the case of GUI programming?


I'm learning to develop GUI applications in python, searched a lot but didn'nt find a satisfactory answer to the use of root.tk.eval() in the code

from tkinter import tix
root = tix.Tk()
root.tk.eval('package require Tix') 

Solution

  • Tkinter is a relatively thin object-oriented wrapper around an embedded TCL interpreter (TCL is a completely different programming language). root.tk.eval lets you directly run TCL code in that embedded TCL interpreter.