468,316 Members | 2,096 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,316 developers. It's quick & easy.

how to call user defined TCL procedures from python script?

Hi,
I am using some TCL driver APIs and user define TCL function to
control a traffic generator. The APIs are the traffic generator's
specific and in built to the driver library.

The issue is calling API and user define TCL functions from python
script.
I am looking for the way to include user define TCL lib to python
script and call those user define functions from python script.
thanks & regards
ananya

Nov 21 '06 #1
1 3273
comp.lang.python wrote:
I am looking for the way to include user define TCL lib to python
script and call those user define functions from python script.
If you import Tkinter and then evaluate Tcl-Script, passing back the results
a strings into Python. Example:

>>import Tkinter
tcl=Tkinter.Tk()
tcl.withdraw()
''
>>tcl.eval("puts hello")
hello
''

With this you can load Tcl-Libs ("package require ..."), execute the needed
functionality and "return $VALUE" to pass results to Python.

HTH
Stephan

Nov 21 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by chreo | last post: by
13 posts views Thread by Larry Menard | last post: by
8 posts views Thread by Bernard Lebel | last post: by
3 posts views Thread by Lauren Quantrell | last post: by
275 posts views Thread by Astley Le Jasper | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.