Webbrowser written totally in Python

faulkner faulkner612 at comcast.net
Sun Sep 17 15:44:43 EDT 2006


this was just on digg:
######################
import wx
from urllib import urlopen
import wx.html

class Frame(wx.Frame):

	def userPageButton(self, event):
		goToPage=self.userPage.GetValue()
		goToPage='http://www.' + goToPage
		webpage=urlopen(goToPage).read()
		displayPage=self.html.SetPage(webpage)

	def __init__(self):
		wx.Frame.__init__(self, parent=None, id=-1, title='microBrowser',
size=(800, 600), pos=(50, 50))
		panel=wx.Panel(self)
		self.userPage=wx.TextCtrl(panel, pos=(400, 5)) #
		self.html = wx.html.HtmlWindow(panel, id=-1, size=(780, 530),
pos=(10, 35), style=wx.html.HW_SCROLLBAR_AUTO)
		userPageButton=wx.Button(panel, label='Go!', pos=(300, 5))
		userPageButton.Bind(wx.EVT_BUTTON, self.userPageButton)

class App(wx.App):

	def OnInit(self):
		self.frame=Frame()
		self.frame.Show()
		self.SetTopWindow(self.frame)
		return True

if __name__=='__main__':
	app=App()
	app.MainLoop()

#################
there are also python bindings for gtkmozembed in gnome-python-extras
and here:
http://sourceforge.net/projects/pygtkmoz


Franz Steinhaeusler wrote:
> Hello NG,
>
> is there any (GUI) webbrowser written completly in Python?
> 
> in pyGtk, pyQt, wxPython or TkInter?
> 
> -- 
> Franz Steinhaeusler




More information about the Python-list mailing list