Python for TCLer

Bhushit Joshipura bhushit at hotmail.com
Wed Jun 23 13:49:52 EDT 2004


I am almost brainwashed to forsake TCL for Python. However, I wanted
to ask a few preliminary questions before I jump in.

The over all picture of my project would look like:

Front End : TCL scripts - Our API to users (Can't change because of
legacy)
----->Middle Layer : Framework (PYTHONization Target)
Back End: TCL API from vendors (Can't change), in-house Expect API
(can't risk for reliability)

1. One of my vendors supplies TCL package only. Can I call TCL
procedures from Python back end? What about Expect scripts?

2. OTOH, all my scripts are in TCL. Can I invoke python from TCL and
retain states in python?

3. This is closely related to uplevel question already discussed in
this group. We have one control structure in our API that has done
wonders in productivity. I can not let it go.

Does python let me write a control structure? It looks like:

set x 10
set y 5
controlStructure {
 do something with $x until y becomes 3 ;#This is evaluated in
caller's frame
}

4. Does there exist a mapping of TCL facilities over Python? It will
help me in training man power. Ideal place would describe

uplevel "..."
would translate to
<python equivalent>

eval "..."
would translate to
<python equivalent>

subst "..."
...

5. Does Aspect Oriented Extension exist for Python? I know TOS
(http://www.aopsys.com/tos) is no longer maintained for TCL.

Thanks in advance,
-Bhushit



More information about the Python-list mailing list