I'm building a python app that should get a certain HTML code, render it and display the result to the user in a tkinter gui. How can I do that? I would prefer having some built-in module, or some module which I can use easy_install to get. Thanks for any advance.
(I'm using OSX Yosemite with python 2.7)
I've managed to render simple html tags using tkhtml
just pip3 install tkinterhtml
and, from the package example:
from tkinterhtml import HtmlFrame
import tkinter as tk
root = tk.Tk()
frame = HtmlFrame(root, horizontal_scrollbar="auto")
frame.set_content("<html></html>")
frame.set_content(urllib.request.urlopen("http://thonny.cs.ut.ee").read().decode())
Hope it helps :)
Save your HTML to a file location, and use the webbrowser
module's open()
function to display it; see https://docs.python.org/2/library/webbrowser.html for documentation.
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