[Edu-sig] Simplest webapps

Aivar Annamaa aivar.annamaa at ut.ee
Wed Mar 28 03:18:54 EDT 2018


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/edu-sig/attachments/20180328/d2f010a9/attachment.html>


More information about the Edu-sig mailing list