• 0

How do you Embed Webkit in a Python GUI/WxPython (cross platform) and Qt5/PySide License Conflicts


Question

Hi,

I am the lead developer for the project PHP Nightrain. Currently, it is coded in Python and using WxPython to create the GUI, etc? For the most part it does what it was designed to do.

But it is not quite where I would like it to be. Currently, it is using the WebView control from WxPython. So, on Windows the software uses IE, on OS X it uses Safari and on Linux it needs the libwebkit-dev to work. The WebKitCtrl is only for OS X :(

I want to accomplish the following:

1. Remove WxWebview or make it optional.
2. Embed WebKit in my Python application. So, on Windows, Linux and Mac it will use webkit by default.
3. Everything has to be packaged in a single executable. I don?t want my users to manually install libwebkit-dev, etc? Not really sure how to accomplish that with pyinstaller.

Can you give me a top level idea on what I will need to do to make it possible? I guess the main question I am asking is?. how do I take webkit source and bind it in my Python application? I am assuming I will have to learn C/C++? but I?m not sure where to go after learning C/C++?

Qt5 bindings for Python was excellent. But their confusing licensing terms is making me skeptical to use their solution.

PHP Nightrain is licensed under MIT and PySide is licensed under LGPL but the actual Qt5 libraries are licensed under GPL, LGPL and Commercial. Can my project use PySide without any restriction? I want my users to download PHP Nightrain binaries and use it for whatever they want (open source, commercial, whatever). So, I am not sure whether PySide LGPL license and Qt5 Licenses will make an issue out of it :/?

5 answers to this question

Recommended Posts

  • 0

https://code.google.com/p/cefpython/

 

Author of PHP Desktop made a project for embedding chromium into a python project ;)

 

This project supports embedding in PyGTK, PyQt and PySide.

  • 0

As far as I've come to understand you're free to distribute PySide apps so long as they stay open source. I also found it very confusing. With that in mind packaging it into a single executable may break that license. I've yet to see a reliable method of packaging Python 3 into a single file. Python 2 can do it though I hear.

  • 0
  On 25/09/2014 at 13:45, simplezz said:

I don't know if this is what you're looking for, but there's Python bindings for GTK's Webkit port. GTK works across most platforms.

 

i did use this on my linux distros but there's no precompiled "WebKitGtk" on the Windows platform. And WebKitGtk does not provide any instructions for compiling it to Windows either. It's something along the line where you have to compile Webkit on windows first and then the WebKitGtk bindings... and then you can use PyWebkitGTK. There is a .NET Webkit control though... so, I might have to do something with IronPython -_-

  • 0
  On 25/09/2014 at 19:12, roosevelt said:

i did use this on my linux distros but there's no precompiled "WebKitGtk" on the Windows platform. And WebKitGtk does not provide any instructions for compiling it to Windows either. It's something along the line where you have to compile Webkit on windows first and then the WebKitGtk bindings... and then you can use PyWebkitGTK. There is a .NET Webkit control though... so, I might have to do something with IronPython -_-

It's possible to build the source for Windows (cross compilation or Mingw/Cygwin), but you'd need Mingw and associated tools. Failing that, there are some precompiled binaries around. I can't attest to how well they work or how up to date they are, but it's an option. Ideally, you'd want to build it yourself to get the latest and greatest, as well as compiler optimisations (-march=) suitable for the target machine(s). I understand that not everyone is versed in those disciplines though.

This topic is now closed to further replies.