Dear friends,
I'm having a strange issue with a simple python code involving wx and HTML2.
It is a code to run a local html page (on windows) but when I close the browser, the process stays in memory and I have to manually kill it.

Here is the code, I hope you can help me.

import wx 
import wx.html2, os

class MyBrowser(wx.Dialog): 
  def __init__(self, *args, **kwds): 
    wx.Dialog.__init__(self, *args, style=wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.RESIZE_BORDER | wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX) 
    sizer = wx.BoxSizer(wx.VERTICAL) 
    self.browser = wx.html2.WebView.New(self) 
    sizer.Add(self.browser, 1, wx.EXPAND, 10) 
    self.SetSize((800, 700))

if __name__ == '__main__': 
  app = wx.App() 
  dialog = MyBrowser(None, -1)

Thanks for your help,

Any idea?
I still didn't manage to solve it or to understand where the problem is.

Do you have any idea or trick to force closing it completely?
It stays on both if I run it as python script or as exe (converted with py2exe)

Thanks pyTony,
I hadn't look at it carefully untill you pointed me to.
I guess I fixed it just by putting the

self.Bind(wx.EVT_CLOSE, self.OnClose)

Thanks a lot

This question has already been answered. Start a new discussion instead.