By using PyHTML,you can create responsive HTML outputs for Python with program self created windows that are generated by wxPython.It works like Selenium and could render any CSS/JS library like Bootstrap,JQuery,...
Use the package manager pip to install PyHTMLrequirments from freezed reqiurement file:
pip install -r /path/to/requirements.txt
Now you only need to import functions.py to your project.
Add your HTML code to templates folder for example
index.html.As you see,we have
some parameters like {{title}},{{text}} that passed
from python to HTML.
You can pass any DJango
Tags/Parameters/Blocks
to your design.After adding templates,you could render
your HTML from any Python/Django program in a wxPython
windows by using:
from functions import *
if __name__ == '__main__':
django_init()
render_a_html('index.html', 'RenderedIndex.html', {"title": "HelloWorld!", "text": "Hello World!"})
before using render_a_html
,you need to call
django_init() from functions.py.You can
customize your own project settings by edditing this function.
This function is needed to call before using wxPython.
First argument of render_a_html
is your raw HTML template and
second is rendered output name and third is context of variables
that will pass from Python to HTML.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.