Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Python GUI application embedding a web browser - Options?

7,320 views
Skip to first unread message

Paul Moore

unread,
Oct 19, 2016, 6:08:15 AM10/19/16
to
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

Phil Thompson

unread,
Oct 19, 2016, 7:17:21 AM10/19/16
to
The Chrome-based QWebEngineView (http://doc.qt.io/qt-5/qwebengineview.html) is fully supported by PyQt.

Phil

Vincent Vande Vyvre

unread,
Oct 19, 2016, 7:18:14 AM10/19/16
to
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>

Paul Moore

unread,
Oct 19, 2016, 8:14:15 AM10/19/16
to
On 19 October 2016 at 12:10, Phil Thompson <ph...@riverbankcomputing.com> wrote:
> The Chrome-based QWebEngineView (http://doc.qt.io/qt-5/qwebengineview.html) is fully supported by PyQt.

Nice. Thanks for the pointer. Looks like the various bits of advice I
found on the web are a little out of date, is all.

Cheers,
Paul

Mark Summerfield

unread,
Oct 19, 2016, 8:54:09 AM10/19/16
to
Since the application is a web app have you looked at:
https://github.com/r0x0r/pywebview + https://github.com/dddomodossola/remi
or at
https://flexx.readthedocs.io/en/stable/
These basically wrap the platform's web engine so you can write stand alone desktop apps but coding in Python (which gets translated into HTML/JS).

Paul Moore

unread,
Oct 19, 2016, 10:26:05 AM10/19/16
to
On Wednesday, 19 October 2016 13:54:09 UTC+1, Mark Summerfield wrote:
>
> Since the application is a web app have you looked at:
> https://github.com/r0x0r/pywebview + https://github.com/dddomodossola/remi
> or at
> https://flexx.readthedocs.io/en/stable/
> These basically wrap the platform's web engine so you can write stand alone desktop apps but coding in Python (which gets translated into HTML/JS).

I think that's the opposite of what I want (which is a standalone desktop app coded in Python, than embeds an active webpage as a widget in the app). But I'll take a closer look - it may be that I'm not clear on what they are doing (pretty certain, I've barely any experience with what's available for Python outside of command line applications).

Thanks,
Paul

dougla...@gmail.com

unread,
Oct 8, 2017, 11:25:45 PM10/8/17
to
Did you find out the answer for that?

Paul Moore

unread,
Oct 9, 2017, 4:24:36 AM10/9/17
to
On 9 October 2017 at 04:25, <dougla...@gmail.com> wrote:
> Did you find out the answer for that?

Nothing much beyond the pointer to PyQt (which basically said "a lot
of the info on the web is out of date" so I should check the latest
docs). I didn't take it much further, though, as it was a hobby
project and the learning curve for PyQt (any GUI framework, really)
was a bit high for the amount of spare time I had at the time.

Paul

fpp

unread,
Oct 9, 2017, 12:50:37 PM10/9/17
to
Paul Moore <p.f....@gmail.com> said :
Have you looked at CEFpython ?
It seems to work with all major GUIs (Qt, wx, Tk, gtk..)
https://github.com/cztomczak/cefpython/tree/master/examples

wxjm...@gmail.com

unread,
Oct 9, 2017, 1:58:04 PM10/9/17
to
On Windows there are no more working GUI toolkits (tkinter, Qt derivatives,
wx[Python|Phoenix]).

(In one sense, this is a very good situation/status.)

oliver

unread,
Oct 10, 2017, 11:08:20 AM10/10/17
to
Can you elaborate what is not sufficient with Qt's web components?
http://doc.qt.io/qt-5/topics-web-content.html. This allows for HTML, CSS,
Javascript, via either native C++ Qt, QML, or Python (PyQt) or mixtures of
these 3. That said, I have not yet used Qt`s web engine so I don`t know how
full-featured it is, how robust, etc. I have used PyQt for several years in
production grade project and it is very solid and well documented and easy
to program with and easy to write tests for.
Oliver
> --
> https://mail.python.org/mailman/listinfo/python-list
>
--
Oliver
My StackOverflow contributions
My CodeProject articles
My Github projects
My SourceForget.net projects

Paul Moore

unread,
Oct 10, 2017, 11:19:53 AM10/10/17
to
On 10 October 2017 at 16:07, oliver <oliver.s...@gmail.com> wrote:
> Can you elaborate what is not sufficient with Qt's web components?

I can't, sorry. Douglas was resurrecting a thread from a year ago. At
the time I was trying to do a quick proof of concept project and asked
for help on here. The project never really went anywhere, because it
ended up being more complex than I had time for. I don't recall the
details any more.

Paul

yuri...@gmail.com

unread,
Dec 13, 2017, 10:14:19 PM12/13/17
to

yuriv1127

unread,
Dec 14, 2017, 3:15:46 PM12/14/17
to

alexander cutrupi

unread,
Aug 4, 2022, 4:30:26 PM8/4/22
to

alexander cutrupi

unread,
Aug 4, 2022, 4:30:33 PM8/4/22
to
On Thursday, 14 December 2017 at 20:15:46 UTC, yuriv1127 wrote:
balls
0 new messages