Tcl/Tk extension access from python under windows

Discussion in 'Python' started by Marcel Achim, Apr 8, 2004.

  1. Marcel Achim

    Marcel Achim Guest

    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
    Marcel Achim, Apr 8, 2004
    #1
    1. Advertising

  2. 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/
    Mike C. Fletcher, Apr 8, 2004
    #2
    1. Advertising

  3. Marcel Achim

    Ed Suominen Guest

    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
    Ed Suominen, Apr 9, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. hshdude
    Replies:
    12
    Views:
    1,040
    Dimitri Maziuk
    Nov 4, 2004
  2. Alexander Eisenhuth

    Howto debug c++ (SWIG) extension under Windows

    Alexander Eisenhuth, Apr 26, 2005, in forum: Python
    Replies:
    4
    Views:
    832
    Miki Tebeka
    Apr 27, 2005
  3. Michael Reichenbach
    Replies:
    1
    Views:
    468
    red floyd
    Sep 26, 2007
  4. Mumia W.

    Inline::Tcl vs. Inline::Tcl

    Mumia W., Aug 23, 2006, in forum: Perl Misc
    Replies:
    0
    Views:
    131
    Mumia W.
    Aug 23, 2006
  5. Stefan Ram
    Replies:
    5
    Views:
    133
    Stefan Ram
    Mar 17, 2014
Loading...

Share This Page