By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,996 Members | 1,498 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,996 IT Pros & Developers. It's quick & easy.

how to call user defined TCL procedures from python script?

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.