[Zope] Re: [lazug] Executing Shell Script

Kapil Thangavelu k_vertigo@yahoo.com
Wed, 5 Jun 2002 15:14:27 -0700 (PDT)


unrestricted python code  is needed (external method,
or product). if you don't care about the response from
the shell script then using os.system will do the
trick.. please validate your input from the web before
passing to something like this... 

import os
script_command = 'mkdir /root/path/%s'

def execute_my_script(arg):
   os.system(script_command%arg)

if you need to process output try one of the popen
modules (see docs on python.org). ZCVS has a nice
abstraction over this in its ShellCommandProcessor;

hth

-k
   
--- "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
> 


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com