Tcl/Tk extension access from python under windows

M

Marcel Achim

Hi,

I found a tcl extension that does exactly what I need to access a DLL
and it would require a large amount of SWIG glue to generate an
equivalent python extension. I want to access it via
root.tk.call("eval", "package require extension"). I placed the
extension dll (as well as the target DLL) in my Python DLLs path at the
same place where the tcl/tk DLLs are. The eval fails because it doesn't
find the extension. Is there a special initialisation/registration/setup
change to be made to python ?

thanks
Marcel Achim
 
M

Mike C. Fletcher

The default search path for tcl packages from the Python Tcl/Tk is
Python23\tcl\* so create a directory there with the name of the package,
and put a pkgInfo.tcl and your dll into the directory. pkgInfo.tcl
should look something like:

if {![package vsatisfies [package provide Tcl] 8]} {return}
package ifneeded Togl 1.6.0 \
[list load [file join $dir Togl.dll] Togl]

You can use the tcl dde1.2 package you'll find there as a template.

HTH,
Mike

Marcel said:
Hi,

I found a tcl extension that does exactly what I need to access a DLL
and it would require a large amount of SWIG glue to generate an
equivalent python extension. I want to access it via
root.tk.call("eval", "package require extension").
....
_______________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://members.rogers.com/mcfletch/
 
E

Ed Suominen

Marcel said:
I found a tcl extension that does exactly what I need to access a DLL
and it would require a large amount of SWIG glue to generate an
equivalent python extension.

Wow... in nearly three years of programming with TCL (something I now
regret), I've had the *opposite* experience too many times to count. That's
one of the reasons I recently switched to Python -- I got sick of searching
for TCL packages and finding mostly nothing but "Page Not Found" 404 Errors
or ancient, bit-rotted code.

Now that I've been learning Python and exploring the wonders of OOP, I am
kicking myself for learning a "simple" language to make things "easier."
HA!

-Ed Suominen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top