I have a python script that takes inputs from commandline. I simply want to modify this script so I can run it on web. I want the commandline interface to be replaced by a simple boxes in a web page, and once the script is executed, I want the results to be shown on a webpage like it does in commandline.
Any help on where to start, which python packages to use and which steps to take would be much appreciated.
Until now, I read a little about webapp2 for Google App Engine and web.py. I do not want to use Django.
Thank you!
While you can use a microframework like Flask [1] for quickly getting started, you can get closer to the metal. Try learning about the HTTP protocol and implement your own server using the http
module. Python 3's http.server
contains a class SimpleHTTPServer
[2] which can be very good for understanding how you're communicating between the client and your process.
[1] http://flask.pocoo.org/docs/0.12/quickstart/
[2] https://docs.python.org/2/library/simplehttpserver.html
Have you considered using Flask?
http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world
This is a pretty great tutorial on how to make a basic webapp.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With