Simplest webapps

Aivar Annamaa <[email protected]>
Newsgroups gmane.comp.python.education
Message-ID <[email protected]>
Hi!

Let's say my students are able to write programs like this:

    name = input("name")

    if name == "Pete":
         greeting = "Hi"
    else:
         greeting = "Hello!"

    print(f"""
    <html>
    <body>
    {greeting} {name}!
    </body>
    </html>
    """)

I'd like to allow them start writing web-apps without introducing 
functions first (most web-frameworks require functions).

It occurred to me that it's not hard to create a wrapper, which presents 
this code as a web-app (input would be patched to look up GET or POST 
parameters with given name).

This approach would allow simple debugging of the code on local machine 
and no extra libraries are required in this phase.

Any opinions on this? Has this been tried before?

best regards,
Aivar

_______________________________________________
Edu-sig mailing list
[email protected]
https://mail.python.org/mailman/listinfo/edu-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.