I will look at this next morning and try to help, but after a quick skim you are using eval, just word of warning.. try to avoid eval for security!
On Thursday, 8 August 2013 00:16:42 UTC+1, Rijil Hari wrote: > > Hi All, > > I have a python script which i want a user to run in the server, with out > giving a SSH Login permission. I got a web app from below link. How to > connect a webpage with python to > mod_wsgi?<http://stackoverflow.com/questions/16122770/how-to-connect-a-webpage-with-python-to-mod-wsgi> > > Here is the modified version that's working for me > ------------------------------ > > import web > > class Echo: > def GET(self): > return """<html><form name="script-input-form" action="/" > method="post"> > <p><label for="Import"><font color=green><b>Press the button to import > CSV</b></font)</label> > Import: <input type="submit" value="ImportCSV"></p> > </form><html>""" > > def POST(self): > data = web.input() > return data > obj = compile('execfile("importcsv.py")', '', 'exec') > result = eval(obj, globals(), locals()) > web.seeother('/') > urls = ( > '/.*', Echo,)if __name__ == "__main__": > app = web.application(urls, globals()) > app.run()else: > app = web.application(urls, globals()).wsgifunc() > > ------------------------------ > > Script i stored in site.py and I am executing it with the command "*python2.7 > site.py 10.10.10.19:8080*". When user access 10.10.10.19:8080 he can see > the web page and click on the button when he wants the code to be executed. > > Now the issues is > Web Page Stops when i close my SSH Session :( > How do i run it in the background? tried & and that didn't help. > > Thanks and Regards, > > Rijil Hari > -- You received this message because you are subscribed to the Google Groups "web.py" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/webpy. For more options, visit https://groups.google.com/groups/opt_out.
