You are not logged in.
Hello
I want to create a very simple interface with 2 variables, ENDHOUR and ENDMINUTES
After the user enter these two variables, I would like to run
/home/pyther/bin/audio-recorder.sh -h ENDHOUR -t ENDMINUTES
In addition I would also like to output
`ps aux | grep -v 'audio-recorder.sh' | grep -v 'grep' | grep 'rec -q -c 2'
below. How can I do this?
I'm thinking I would want to use python or something like this. My knowledge with web backends are very limited, so examples or guides would be great!
Thanks,
Pyther
Offline
I really like web.py for small web apps like this. Below is some code which should get you started. You'll want to add in some error checking.
import web
import os
urls = (
'/', 'hello'
)
class hello:
def GET(self):
print """
<form method='post' action='.'>
hour: <input type='text' name='endhour' /><br />
minutes: <input type='text' name='endminutes' /><br />
<input type='submit' value='submit' />
</form>
"""
print '<br /><br />'
print '<br />'.join(os.popen("ps aux | grep -v 'audio-recorder.sh' | grep -v 'grep' | grep 'rec -q -c 2'").readlines())
def POST(self):
i = web.input()
os.popen("/home/pyther/bin/audio-recorder.sh -h %s -t %s" % (i.endhour, i.endminutes))
web.seeother('/')
if __name__ == "__main__": web.run(urls, globals())
Last edited by nj (2008-02-03 21:49:39)
Offline