M
Mark d.
I have been trying to make this function run that is triggered from a
button on a Python rendered webpage. Clicking the button gets a
processID, sends a kill command for the process and then generates a
simple web page that displays the processID but the 'kill' command is
not carried out.
def restart():
pid = os.popen('pidof myProcess').read().strip()
os.popen('kill -9 %s' %pid, 'w').close()
print CGI()
print HTML(
HEAD('restart', None),
BODY(None,
'process id:',
pid
))
return 1
This works just fine in the interpreter.
Anyone have any ideas what I am overlooking?
Cheers,
Mark d.
button on a Python rendered webpage. Clicking the button gets a
processID, sends a kill command for the process and then generates a
simple web page that displays the processID but the 'kill' command is
not carried out.
def restart():
pid = os.popen('pidof myProcess').read().strip()
os.popen('kill -9 %s' %pid, 'w').close()
print CGI()
print HTML(
HEAD('restart', None),
BODY(None,
'process id:',
pid
))
return 1
This works just fine in the interpreter.
Anyone have any ideas what I am overlooking?
Cheers,
Mark d.