I have both 32- and 64-bit Python installed on my Windows machine. When I run the below program with 32-bit, it works fine, but with 64-bit, when you click the button to open the HTML page, it crashes with Process finished with exit code -1073741819 (0xC0000005)
. Commenting out the line marked # this line
makes it work, although obviously it doesn't display the HTML. How would I fix this?
import tkinter
from tkinter import ttk
import tkinterhtml
class Gui:
root = None
def open_html_page(self):
local_root = tkinter.Toplevel(self.root)
local_root.transient(self.root)
local_root.grab_set()
big_frame = ttk.Frame(local_root)
big_frame.pack(fill='both', expand=True)
html = "<b>This is an <i>HTML</i> page</b>"
html_frame = tkinterhtml.HtmlFrame(local_root)
html_frame.pack()
print(html)
html_frame.set_content(html) # this line
local_root.mainloop()
def launch_gui(self):
self.root = tkinter.Tk()
big_frame = ttk.Frame(self.root)
big_frame.pack(fill='both', expand=True)
open_html_button = ttk.Button(big_frame, text="Open HTML page", command=self.open_html_page)
open_html_button.pack()
self.root.mainloop()
def main():
Gui().launch_gui()
if __name__ == '__main__':
main()
User contributions licensed under CC BY-SA 3.0