running TCL from python

Cameron Laird claird at lairds.com
Thu Mar 18 12:49:35 EST 2004


In article <mailman.133.1079626702.742.python-list at python.org>,
Avik Ghose  <avikghose at yahoo.co.in> wrote:
			.
			.
			.
>How can I run a TCL script from within my python code?
			.
			.
			.
There are several ways.  Perhaps it's time to enumerate them in a
Wikified essay ...  In any case, I'll wildly speculate that this 
is the one that best models your situation:

  import Tkinter

  tcl_script = 'puts "The sum of 2 and 3 is [expr 2 + 3]."'
  Tkinter.Tk().tk.eval(tcl_script)
-- 

Cameron Laird <claird at phaseit.net>
Business:  http://www.Phaseit.net



More information about the Python-list mailing list