The way I would do it is pass the Spyce module (which is actually an object)
as a parameter to a function in the Python module. Rememeber that there
could be multiple requests running through the Spyce engine simultaneously.
The Python modules are shared among requests. They are just code. The Spyce
modules, however, are not. The Spyce modules are actually objects that are
initialized and associated with a particular request.
In general, however, I'm not sure whether it's such a good idea to do pass
Spyce modules to Python modules. Why not write the functionality of your
Python module as a Spyce module? The rule-of-thumb is that if you need to
access the Spyce engine, for example, the request or response objects, then
you should be writing a Spyce module. General purpose functionality, such as
database connections, HTML parsing, and what-not, can go in Python modules.
More detailed explanation about the difference between Python and Spyce
modules is at:
I hope that helps.
All the best,
----- Original Message -----
From: "Ken Kinder" <ken@...>
Sent: Friday, December 05, 2003 2:14 AM
Subject: [Spyce-users] Importing Spyce Modules from Python Modules
> I understand you import spyce modules using the "[[.import" directive. But
> how do you access a spyce module from a normal Python module used from
Get latest updates about Open Source Projects, Conferences and News.