how to call an external module from a Python script?
I defined an external method "build_adn" which I can call from a DTML-document. How do I call it from a Python script? I tried e.g. "return build_adn (zone)", but it did not work. Peter
On Fri, Sep 21, 2001 at 02:42:15PM +0200, Reif Peter wrote:
I defined an external method "build_adn" which I can call from a DTML-document. How do I call it from a Python script?
I tried e.g. "return build_adn (zone)", but it did not work.
The script needs to know what namespace to look in. To tell it to look up build_adn in the calling context (the folder or object from which you called the script), do this: return context.build_adn(zone) The available namespaces (context, container, script, traverse_subpath) are described in the Zope Book. Go to the chapter on "Advanced Zope Scripts", section "Using Python-based Scripts", item "Binding Variables". -- ................ paul winkler ................ custom calendars: http://www.calendargalaxy.com A member of ARMS: http://www.reacharms.com home page: http://www.slinkp.com
Reif Peter writes:
I defined an external method "build_adn" which I can call from a DTML-document. How do I call it from a Python script?
I tried e.g. "return build_adn (zone)", but it did not work. There is no namespace magic active in Python Scripts.
Try: return context.build_adn (zone) Dieter
participants (3)
-
Dieter Maurer -
Paul Winkler -
Reif Peter