Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Tcl/Tk extension access from python under windows

Reply
Thread Tools

Tcl/Tk extension access from python under windows

 
 
Marcel Achim
Guest
Posts: n/a
 
      04-08-2004
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


 
Reply With Quote
 
 
 
 
Mike C. Fletcher
Guest
Posts: n/a
 
      04-08-2004
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 Achim wrote:

>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/



 
Reply With Quote
 
 
 
 
Ed Suominen
Guest
Posts: n/a
 
      04-09-2004
Marcel Achim wrote:
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
report on building of python 2.5.2 under msys under wine on linux. Luke Kenneth Casson Leighton Python 0 01-15-2009 09:48 PM
A router running under WinXP runs under Windows Vista too? Peter Wagner Wireless Networking 12 02-04-2008 11:02 PM
Howto debug c++ (SWIG) extension under Windows Alexander Eisenhuth Python 4 04-27-2005 11:16 AM
[newbie]How to install python under DOS and is there any Wxpython can be installed under dos? john san Python 19 02-18-2005 12:05 PM
Java application developped under Linux running ridiculously slow under Windows hshdude Java 12 11-04-2004 05:49 PM



Advertisments