Using Tk code directly from Tkinter

Michele Simionato mis6 at
Tue Aug 27 21:35:14 CEST 2002

claird at (Cameron Laird) wrote in message news:<946D85627FA3D219.9145EC7E48D59742.D0234BA543F6A756 at>...
> In article <3d6b496a at>,
> Volker Dobler <volker.dobler at> wrote:
> >Hello,
> >
> >I'd like to use Tk code directly in Tkinter:
> >gnuplot can produce plot output as Tk commands stored
> >in a file ''. Basically a procedure gnuplot is defined
> >which needs a canvas widget. Calling this procedure will
> >draw the plot in the given canvas.  Is it possible to feed
> >such a file into Tk via Tkinter or would it be easier to
> >write a new terminal for gnuplot which outputs Tkinter
> >code to be execed in Python?
> >
> >Volker
> >
> >
> >
> Yes, it is possible to ask Tkinter to interpret Tcl
> source.
> There are a couple of ways to go about this.  Does
>   import Tkinter
>"source myscript.tcl")
> give you the start you want?

This way I get an error. I tried

from Tkint import *
c=Canvas()"source gnuplotscript.tcl") 

which gives no errors but no output too !

Michele Simionato - Dept. of Physics and Astronomy
210 Allen Hall Pittsburgh PA 15260 U.S.A.
Phone: 001-412-624-9041 Fax: 001-412-624-9163

More information about the Python-list mailing list