[Zope] Executing Shell Script

Juergen R. Plasser / Hexagon plasser@hexagon.at
Thu, 06 Jun 2002 12:52:36 +0200


I use the following short Python script for testing purposes only (located 
in the Extensions folder):

from os import popen2

def exeshell(self):
        """ exeshell executes shell command """

        (stin,stout) = popen2('script')
        stin.close()
        result = stout.read()
        stout.close()

        return result

The script is called via External Method.

hth,
Juergen

--On Mittwoch, 05. Juni 2002 14:58 -0700 "Tran, Mike" 
<MTran@shufflemaster.com> wrote:

> Hi All,
>
> How do i create a method that will excute a shell script when called?
> I just wanted to run a local shell script when a user clicks on a button.
>
> Appreciate any suggestion,
>
> Mike
>