Run python code with html5

Basically, I want to create a sexy GUI using HTML5, and then call the code I wrote in python. I just opened some web2py tutorials, however now I get videos from youtube, so I can only watch when I get home. (Student life without internet at home).

So basically I wrote a python script, now I want to use a webpage to interact with this script instead of a terminal, as I did. So I have a webpage that provides me with a graphical interface for my python application.

Hope this makes more sense.

We will be very grateful for any help and guidance.

Thank you in advance

+4
source share
1 answer

You need to flip this, you want to run the code on the python side on the server side, which displays your own HTML5 GUI. Many Python frameworks are suitable for this, including web2py , django, and my personal favorite flask .

Any of these frameworks will let you run your Python code and then render HTML with python variables / functions accessible via the template engine (e.g. Flask uses Jinja ). Tutorials are readily available for all of these python libraries, but if you want to take a look at Flask, I can recommend Miguel Greenberg's excellent tutorial series.

+5
source

Source: https://habr.com/ru/post/1527941/


All Articles