views:

1324

answers:

9

Developing a web browser in Python - is it possible?

+1  A: 

Yes. Here's an example using GNOME and Python

Brian Agnew
+6  A: 

Sure, it's possible. Why should it be any different to other languages? Python is still a complete and proper programming language, even if it is rather high-level. Now I'm not sure it would produce great performance, which is somewhat desirable for the rendering and JavaScript engines of a browser, in particular. Nonetheless, you could without any extraordinary difficulties (mainly just the usual ones) create a fully-fledged browser in Python.

The question is: why would you want to do that anyway, with all the browsers already out there having had enormous head-starts? You'd be starting your codebase from scratch, so you'd be looking at many years before approaching the feature set of popular browsers such as Firefox or IE.

Noldorin
+2  A: 

Using PyQt4 you could write a very capable browser by combining Python with Qt4. Alternatively, wxPython does much the same thing but with wxWidgets.

Paul Dixon
A: 

This question is hard to answer. Many scripting languages, using builtin libraries, allows you to connect to a host and download the webpage (in raw html) using extremely few commands.

That could, arguably, be called a web browser. But what about downloading and displaying images? Javascript? Cookies? History, bookmarks, saving passwords and other "standard" web browser features?

But as OregonGhost stated; "Why should [it with python] be any more or less possible than with any other language?". Given enough time and processing power, any turing complete mechanic can me modelled in any turing complete languge, such as python.

The answer to your question is yes. No more and no less. You have to be more specific to get better information, otherwise you will just get answers disscussing how your question should be interpreted. Like my answer.

mizipzor
+2  A: 

Grail is a web browser written in Python.

RichieHindle
+1  A: 

Grail is an example of web browser written in Python, but the project is dead now.

Bastien Léonard
+1  A: 

At least one has been written, Grail. While it is no longer maintained, it is an interesting starting point.

bortzmeyer
+1  A: 

To elaborate on Paul Dixon's answer, this would be relatively easy using PyQt. Since Qt 4.4, the QtWebKit module has been available, giving you a rendering engine without any extra work. This is, of course, accessible by the Python flavor of Qt (PyQt).

Here are some examples of it in action!

John T
A: 

http://bitbucket.org/patx/fastpatx

fastPATX is my own little web browser. It has tabbed browsing and many more features. Written in PyQt4, BuzHug, and Python. For those of you who do not know, PyQt4, and BuzHug are written in Python :)

patx