Python GUI application embedding a web browser - Options?

Vincent Vande Vyvre vincent.vande.vyvre at telenet.be
Wed Oct 19 07:12:13 EDT 2016


Le 19/10/2016 à 12:07, Paul Moore a écrit :
> I'm looking to write a GUI application in Python (to run on Windows, using Python 3.5). The application is just a relatively thin wrapper around a browser - it's presenting an existing web application, just in its own window rather than in a standard browser window. I'm looking for advice on a good GUI toolkit to use.
>
> I've not done much GUI programming in Python, so I don't have a "preferred toolkit" as such. A bit of Google searching found an embedded browser widget in PyQt, but the examples I tried didn't work - it looks like the QWebView class is deprecated and has been removed in the current version of PyQt. I haven't really found any other examples (there's a "embedding a web page in Tkinter" example I found, but it looks like it's just doing rendering, not embedding a full browser - which I need as the site I want to access uses CSS/JavaScript).
>
> Is there any good option for this, or would I be better looking elsewhere for a solution? I could probably work out how to knock something up using .NET, or a HTA file, for example, I'm just more comfortable coding in Python.
>
> Thanks,
> Paul

Hi,

PyQt is a good choice to embed a web viewer in a GUI application.

There's no great differences between Qt4 and Qt5.

An example with PyQt4:
http://bazaar.launchpad.net/~vincent-vandevyvre/oqapy/2.0/files/head:/oqapy-2.0/g9n/

The same with PyQt5:
http://bazaar.launchpad.net/~vincent-vandevyvre/oqapy/3.0/files/head:/g9n/

-- 
Vincent V.V.
Oqapy <http://www.oqapy.eu> . python3-exiv2 
<http://www.py3exiv2.tuxfamily.org/> . Qarte 
<https://launchpad.net/qarte> . PaQager <https://launchpad.net/paqager>



More information about the Python-list mailing list