r/Python • u/[deleted] • Oct 26 '14
Run python scripts from web
Hello everyone,
I have some python scripts that I need people can execute via web, passing some variables to the script with a form.
Any idea? something where to start, I am so lost with this.
For example, a telnet script to enters a router and change some stuff.
What I need is a webpage with a form, where the user can pass some variables to the script, send the form, execute the script described above and show some output.
Its possible using only python? I dont want to use php in the web, I just want to use python.
any help is welcome thank you guys : )
0
Upvotes
1
u/feuermelder Oct 26 '14
Old but very simple method would be CGI. Check it out... it's two or three more lines in your python script, if you're down to the if name == 'main' part. And don't forget to sanitize user input or you will get into trouble really fast.