skip to Main Content

I am proficient in Bash and a beginner in Python (I have some experience with Flask and Requests).

I wrote a Bash script which asks for some input (four strings) and creates a configuration file based on that input. That’s good for me, but I would like to convert it to a (no frills) web interface. I know how to configure Apache, if necessary.

I know there are zillions of ways to do that. I’d like some hints on how to tackle my problem, ideally using Bash or Python. By the way, I’ve used Octave on CGI for some of this in the past, and I think it’s excellent for math purposes, but I’d like to get ideas about some simpler, more generic avenues.

2

Answers


  1. You probably just need the right keywords to go the right direction. From a high level all you need to to is two steps:

    • Create a static html web page that contains a form. This form contains at least one input field and a submit button. The URL it accesses needs to be understood by your webserver to invoke your script via the common gateway interface (CGI).
    • write a python or bash script that Apache can invoke via CGI that receives the value and does something about it. The stdout of this script will be returned back to the browser, so it better be HTML again.

    For details check out http://httpd.apache.org/docs/2.4/howto/cgi.html

    Login or Signup to reply.
  2. I would create a Django site for this. It can be setup really quickly. I would recommend you host it on PythonAnywhere. They have a free tier, and works really well. Django is similar to Flask, but I personally like Django. If you could be more specific on what your App needs to do, some sample code could be provided.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search