example of external program execution from zope

Wolfgang Strobl wks000 at t-online.de
Sat Mar 15 16:38:49 CET 2003


"shagshag13" <shagshag13 at yahoo.fr>:

>i'm looking for examples of external program executions from zope or even
>examples of zope object wrapping external programs and catching output,
>i'm really interested in any ressources or links, and don't know where to
>start search (google didn't help me this time)

a) Put this into <zope>\Extensions\qaz.py:

import os
def qaz():
        return os.popen("dir *.*").read()

b) Add an External Method 'qaz' somewhere, id=qaz. Module Name=qaz,  
    Function  Name=qaz.

c) Use the "Test" tab or use it like so: <dtml-var qaz>, i.e.

<dtml-var standard_html_header>
<h2>var</h2>
<pre>
<dtml-var qaz html_quote>
</pre>
<dtml-var standard_html_footer>


-- 
Thank you for observing all safety precautions




More information about the Python-list mailing list