Running TCL code from Python

I want to be able to run tcl script from my python script. In particular, I want to run a tcl script like this .

I have some knowledge about python and about no tcl.

I tried things like:

import Tkinter r=Tkinter.Tk() r.call('source{DIS.tcl})' or r.tk.eval('source{DIS.tcl})' 

Any ideas how I could access things from a tcl script? Thanks!

+4
source share
2 answers

Tcl is very space-sensitive (just like the Bourne shell). You probably want source DIS.tcl instead of source{DIS.tcl}

+2
source

try it

 import Tkinter r=Tkinter.Tcl() r.eval('source DIS.tcl') 
+2
source

All Articles