Invoking Python modules from Scheme
Grant Edwards
grante at visi.com
Tue Dec 12 10:40:43 EST 2000
There seem to be a fair number of Schemers around, and I
thought you might find this interesting.
Background: STk is a Scheme implimentation that includes
bindings to the Tk widget set, and an object system based on
tiny CLOS.
STk uses direct bindings to the Tk lib w/o Tcl, which has some
advantages and disadvantages. Scheme variables can be attached
directly to widgets without the intermediate IntVar and
StringVar stuff. The main disadvantage is that there's a lot
more work involved when the Tk library changes.
The STk home page is at:
http://kaolin.unice.fr/STk/
Anyway, Walter Moreira has developed an interface that allows
gives STk access to Python modules/objects:
--------------------[from the STk mailing list]--------------------
From: Walter Moreira <wall at adinet.com.uy>
To: stk at kaolin.unice.fr
Subject: STk interface to Python
User-Agent: Mutt/1.0.1i
Resent-Message-ID: <"j-XDsB.A._3.z5VN6"@kaolin.unice.fr>
Resent-From: stk at kaolin.unice.fr
X-Mailing-List: <stk at kaolin.unice.fr> archive/latest/488
X-Loop: stk at kaolin.unice.fr
Precedence: list
Resent-Sender: stk-request at kaolin.unice.fr
Hello.
I wrote a small interface for invoking Python's libraries from
STk. It includes a STk type that represents an arbitrary Python
object and provides a mecanism for handling Python exceptions:
a try-except block.
For example, you can do
(define http (py-getattr "BaseHTTPServer"))
and you have the complete Python's BaseHTTPServer' module for
writing your own Scheme HTTP server.
It can be downloaded (only 25k) from
http://www.cmat.edu.uy/~walterm/spy
Please, take a look and let me know if you find it interesting.
Walter
-------------------------------------------------------------------
--
Grant Edwards grante Yow! Okay... I'm going
at home to write the "I HATE
visi.com RUBIK's CUBE HANDBOOK FOR
DEAD CAT LOVERS"...
More information about the Python-list
mailing list