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
2
u/ggtsu_00 Oct 26 '14
Use bottle.py a simple one-file micro web framework.
Make a file called script.bat that does what ever you want in the same location of your directory and it will run your python file.
Then go http://localhost:8080/run/script.bat
Btw, for safety, dont expose this on the public internet as it is a backdoor to execute arbitrary code on your PC.