I need to execute another script like from the command line, passing
arguments just as i would do it at the command line. what i am trying
to do is build an interface to the newlist script via email, so i
attempted:
def ProcessNewListCmd(self, args, cmd, mail):
if len(args) < 4:
self.AddError("missing arguments")
return
cmd = "%s %s %s >> /etc/aliases" % (mm_cfg.PYTHON,
"/home/mailman/bin/newlist",
args)
cmdproc = os.popen(cmd, 'r')
status = cmdproc.close()
if status:
self.LogMsg('newlist',
'Non-zero exit status: %d\nCommand: %s' %
((status >> 8), cmd))
self.AddToResponse('Succeeded.')
(yes, i'm going to add error checking later)
but it's not working at this point. can someone help? The python docs
are lacking details in many areas, and the exec, popen, etc are ones
that i need docs on :)
Regards,
Mark Williamson