I have a python cli script that asks for a series of different inputs, processes them and prints an output for every input, maintaining a state. Es:
form:Type your name
user: myname
script: your name is myname and it has 6 letters
form: Type your surname:
user: mysurname
script: your surname is mysurname and it has..
script: you are myname mysurname
I'd like to give it a web interface. I know how to use AJAX and CGI to get one single input and print one single output in a web page.
Is there a more elegant way to do it without splitting my script in several parts and recording its state inside a file?