Browser engine encoding, Python / C++


New Member
I'm working on an IDE and I'd like it to run in its own browser. I see lots of good docs for doing this in C++ and I can handle that but I'd like to write it in Python so the code itself is available for hacking to a larger group of people. The IDE itself will not be a heavy process so the only actual advantage there is to using C++ is support.
Can anyone tell me where I can look for reasonably documented Python browser support? Alternatively a better place to ask this question would be welcome.


Well-Known Member
I haven't used any of the webkit modules with python - so I'm not sure how suitable any of these libraries are for your project, but what about the python/QT bindings for Webkit?
On a Debian based distro the package name is:
python-pyqt5-qtwebkit - for python2 - or python3-pyqt5-qtwebkit for python3.

That would add QT to your project as a dependency. But you should be able to use the webkit module to embed a browser.

There's also a browser control in the wxWidgets widgets library called wxWebview - so you could perhaps look at using wxPython.

There used to be python bindings for the GTK webkit module too. Which used libwebkitgtk as a backed. But I don't think those python bindings are available any more. It might have been abandoned/orphaned or something - IDK. But I don't see anything in the repos.

And if none of those options are appropriate - the only other option would be to create your own browser control using one of the C/C++ webkit libraries and then create your own python bindings/wrapper for it - if your IDE is python based.


New Member
Thanks for your response.

I have Python working with libwebkitgtk
1 #!/usr/bin/python
3 import gtk
4 import webkit
5 import sys
7 class Browser( object ) :
8 def __init__( self, path, title = None ) :
9 win = gtk.Window()

{ . . . }

The code I mostly put together with trial and error loads an SVG file and runs the external Javascript. i.e. it works, so I suspect that given documentation I might be able to use it, but that documentation is lacking.

I can also use Python by integrating a server the normal way, my objective is to make deployment optional, standalone or web server based. This is not a requirement but it is highly desirable.

Creating my own Python interface would work, but it's work that I don't need to do for the end product so it would be feature creep. I did consider that originally and discarded the idea as a significant distraction.

At the end of the day I'd like to use a Python interface for accessibility to the code but that accessibility isn't a required feature of the end product. I haven't used C++ is quite a while. If I need small and fast I hit it with 'c', otherwise it's Python. I also find coding in Python to be a lot of fun, I just like the language. C++ can be fun too.

I'll take a look at QT.

Edit: I should tell you what the objective is. The IDE isn't for Python code it's for a JavaScript engine to manipulate graphic objects that has been in my head for a while. I wrote a JS parser process in in c, and it is small and fast but it's written like C++ anyway, were I to expand on it at all I'd probably convert it to C++ for maintenance reasons.
Last edited:

Members online