Basically I want to create a sexy GUI using HTML5 then call code that I wrote in python. I have just discovered some tutorials about web2py, however I am getting the videos now from youtube so I can only watch when I get home. (Life of a student with no internet at home).
So basically I have written a python script, now I want to use a webpage to interact with that script instead of terminal as I have been doing. So I have a webpage provide me the GUI to my python app.
Hope this makes more sense.
Any help and direction will be greatly appreciated.
Thanks in advance
A very common application for HTML5 in the modern world of Python programming is display inside of IPython notebooks. This is usually done with either HTML5 or Javascript.
The new PyScript project lets you embed Python programs directly in HTML pages and execute them within the browser without any server-based requirements.
cmd /k is the typical way to open any console application (not only Python) with a console window that will remain after the application closes. The easiest way I can think to do that, is to press Win+R, type cmd /k and then drag&drop the script you want to the Run dialog. Fantastic answer. You should have got this.
It is possible to run embed Python within a HTML document that can be executed at run time.
You need to flip that around, you want to run server-side python code that renders your sexy HTML5 GUI. There are many Python frameworks that are suitable to this, including web2py, django, and my personal favorite flask.
Any of these frameworks will let your python code run, then render the HTML with python variables/functions available by using a templating engine (for example Flask uses Jinja template). Tutorials are readily available for all of these python libraries, but if you want to take a look at Flask, I can recommend Miguel Grinberg's excellent tutorial series.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With