Embedding TCL in Python?

Roy Smith roy at panix.com
Sun Dec 23 20:15:50 EST 2001


I've got a device I want to control, and a set of TCL routines which talk 
the device's (proprietary) protocol over the network.

I'm building an automated test system in Python, and one of the things I 
need to do is control this device.  Seems to me I've got three choices:

First, I could build a native Python module to control the device directly.  
I've discounted this as being way too much work, even though the end result 
would probably be the cleanest way to do things.

Second, I could start a separate TCL interpreter process, and have my 
Python program drive it with some sort of send/expect type interface.  
Possible, but ugly, and probably a real mess to code.

Lastly, I could just embed a TCL interpreter right in my Python process.  
This seems like it has promise, but I don't have much of a clue how to go 
about doing it.  Has anybody done anything like that before?



More information about the Python-list mailing list