[Zope] Executing Scripts in Zope

Sorin Marti mas@semafor.ch
Fri, 07 Mar 2003 14:20:02 +0100


Andreas Jung wrote:

> 
> You can not start shell skripts from Zope. At least on directly.
> Create an ExternalMethod that starts your script using os.system()
> or os.popen(). Check with the Zope Book for details.
> 
> -aj


First of all: Thanks to Andreas for answering my questions all the time!

I read stuff in the python manual about os.system() and I read a 
tutorial about External methods on zope.org

Now I've got following code:


--------------------
def ltoh(self):
     """Compile TeX-File"""
     import os
     msg = os.system( 'latex2html /home/mas/test.tex' )
     if msg == 0:
         return 'Successfull'
     else:
         return 'Not Successfull'

--------------------

That works fine. Now I want to pass a parameter (the filename) and that 
doesn't work.

How do I pass parameters? I tried a few things but nothing worked...
A link to a good tutorial or manual would be great also.

Thanks in Advance
   -mas