I am trying to convert a command line script written in python in to a web application.
I intend to design a web application using python and flask. The user will provide some input on the webpage and submit it. The input data will then be passed as arguments to a function written in python (basically the old script). This function will be doing a lot of things. As the function is being executed, I would like to show the status of function execution (completed steps) on the web page in real time.
For example -
If the user enters the values for the fields - radius, length, breadth, base, height
on the webpage and clicks a submit
button, a function named calculate_area(radius, length, breadth, base, height)
will run and the application should periodically send the area for circle, rectangle and triangle one after the other with some time delay between each area calculation. Eg.
Calculating area of circle ...
Area of circle is - xxx
Calculating area of rectangle ...
Area of rectangle is - yyy
Calculating area of triangle ...
Area of triangle is - zzz
Can someone point me to what can help to achieve this? Thanks in advance.