views:

84

answers:

1

Is there any way to get Python to use my ActiveTcl installation instead of having to copy the ActiveTcl libraries into the Python/tcl directory?

+2  A: 

Not familiar with ActiveTcl, but in general here is how to get a package/module to be loaded when that name already exists in the standard library:

import sys
dir_name="/usr/lib/mydir"
sys.path.insert(0,dir_name)

Substitute the value for dir_name with the path to the directory containing your package/module, and run the above code before anything is imported. This is often done through a 'sitecustomize.py' file so that it will take effect as soon as the interpreter starts up so you won't need to worry about import ordering.

Mark Roddy
Thanks! That answers my question. I shouldn't have mentioned ActiveTcl. I just mean a regular, standalone Tcl installation.
Matt Gregory