Python calling python?
Somebody make this simple for me. I have two python scripts (internal not external). I want to call the first script using DTML/ZPT. I have no problem in that regard... BUT... I want to call then use th first script to call the second script. As soon as I try to include that functionality it falls apart. If I try to import I get 'not authorized'. If I try to access it the same way I do ZSQL methods 'context.whatevername()' I get "whatevername" not defined. What am I missing? Is it a security thing? Did I miss some important piece of documentation? _________________________________________________________________ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail
On Mon, Mar 03, 2003 at 10:22:12PM +0000, Michael Havard wrote:
script to call the second script. As soon as I try to include that functionality it falls apart. If I try to import I get 'not authorized'.
they're not modules anyway, so importing them could never work...
If I try to access it the same way I do ZSQL methods 'context.whatevername()' I get "whatevername" not defined.
that should work. check your spelling, and that script1 can acquire script2. -- Paul Winkler http://www.slinkp.com
On Mon, 3 Mar 2003, Michael Havard wrote:
Somebody make this simple for me. I have two python scripts (internal not external). I want to call the first script using DTML/ZPT. I have no problem in that regard... BUT... I want to call then use th first script to call the second script. As soon as I try to include that functionality it falls apart. If I try to import I get 'not authorized'. If I try to access it the same way I do ZSQL methods 'context.whatevername()' I get "whatevername" not defined.
What am I missing? Is it a security thing? Did I miss some important piece of documentation?
You can call another acquirable python script using context.otherscript(arg,...)
If I try to import I get 'not authorized'.
Import is not available in Python Scripts. So it's never authorized.
If I try to access it the same way I do ZSQL methods 'context.whatevername()' I get "whatevername" not defined.
That should work if 'whatevername' is in 'context'. Find out what 'context' is and make sure it acquires 'whatevername'. Depending on your organization, 'container' may be better, as it is more explicit. --jcc
participants (4)
-
Dennis Allison -
J Cameron Cooper -
Michael Havard -
Paul Winkler