• 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.
  • Posts

    • Here's my scenario: I have an intel i5-10600 based system using a Gigabyte Z590 Aorus master motherboard with an EVGA GeForce GTX 1070 (non-TI) graphics card. The PC has three monitors, 2 x Dell SE2717H/HX and an older Samsung monitor. The monitor configuration is Dell SE2717H - Samsung, Dell SE2717H. (1) The left Dell monitor is connected to the 1070 by via DP out on the 1070 (DP to DVI adapter connecting DVI to HDMI cable) going to HDMI input on the monitor. (2) The center Samsung is connected to the 1070 via HDMI output on the 1070 to HDMI input on the monitor itself. However I have a HDMI duplicator connecting the Samsung monitor to a NanoKVM box. Will explain this more in a moment. (3) The right Dell monitor is connected via a DP to HDMI cable. It's connected to DP out on the 1070 and HDMI input on the monitor. When the PC is powered on, the right (3) monitor is the default monitor showing the BIOS and POST screens before booting into Windows where the center Samsung becomes the primary monitor. I have the Samsung set as the primary in Windows, but that obviously doesn't affect the BIOS/POST. I had swapped the right Dell and center Samsung thinking the monitors were dictating the settings, but when I reconnected them, the Samsung was on the right, it still remained the priority monitor during BIOS/POST time. So I reverted those changes. I followed the EVGA card port priority per this official EVGA page ( https://www.evga.com/support/faq/FAQdetails.aspx?faqid=59560 ) which indicates the following priority of ports: - DVI - HDMI - DisplayPort (middle) - DisplayPort (far right) - DisplayPort (far left) With the DVI port not in use, I verified the center Samsung monitor was on the HDMI port on the 1070. The left Dell monitor was connected to DP (middle) and the right Dell monitor was connected to DP (far right). However during BOOT/POST, the right Dell remained the priority. I created all sorts of combinations of moving the center Samsung to the middle DP port (using DP to HDMI adapter), for the higher priority # and moving the left and right Dell monitors to far right and far left DP ports. However the right Dell monitor remained the BOOT/BIOS priority default. Why does this even matter?? The reason I'm trying to solve this puzzle is because I recently purchased a NanoKVM PCIe card that gives full BMC access to the BIOS and visuals via HTML5 web interface to pre-Windows boot time. In the event I need to troubleshoot when I'm away from home. The NanoKVM has an HDMI input port so it can grab the screen and share it via the HTML5 built in portal on it's remote IP access. Because the NanoKVM isn't multi-monitor aware, it's designed to only display the monitor that it's plugged into in the video card so I can see the  boot /BIOS screens and the Windows default monitor. Because there is no HDMI passthrough on the NanoKVM, I purchased a HDMI duplicator/splitter (NOT an extender).   This HDMI extender connects to the HDMI output on the 1070. My center Samsung monitor is connected to splitter output port #1 with a standard HDMI cable and the NanoKVM is connected to splitter output port #2 with a standard HDMI cable as well. When I disconnect both Dell monitors and leave this setup connected to HDMI, it works flawlessly. When I connect the left Dell monitor to the above far left DP port on the 1070, the setup still works great as the center Samsung still remains the default/priority. But when I connect the right Dell monitor to the far right DP on the 1070, the right Dell becomes the default/priority monitor during BOOT/POST time. This results in the NanoKVM not having access to/displaying the contents of the right Dell when it's priority during BOOT time, but once the PC boots into Windows and it's the default monitor/port, the KVM displays that just fine then. However, this defeats the purpose of needing the KVM which is to provide access to the BIOS and boot menu settings in the event of an emergency while I'm away from home. Any idea on what I'm doing wrong? Do I need to replace the center Samsung?? Different monitor / adapter cables??? Do I need to upgrade the video card? I have a 980Ti, but per the EVGA docs, the port priority is the same for it as the 1070. Thoughts?? Suggestions???
    • I've had the Ryzen since it first went to market. I've had Windows 11 since beta testing it in the early days... Ryzen worked just fine, Windows didn't... so, not sure what this "four years" it is you're referencing since you're not specific as to who fixed what.
    • A toggle option for automatic call recording will be welcomed. I see no harm in providing it as the call recording prompt is played by the iphone.
  • Recent Achievements

    • Mentor
      Karlston went up a rank
      Mentor
    • One Month Later
      EdwardFranciscoVilla earned a badge
      One Month Later
    • One Month Later
      MoyaM earned a badge
      One Month Later
    • One Month Later
      qology earned a badge
      One Month Later
    • One Year In
      Frinco90 earned a badge
      One Year In
  • Popular Contributors

    1. 1
      +primortal
      474
    2. 2
      snowy owl
      256
    3. 3
      +FloatingFatMan
      254
    4. 4
      ATLien_0
      210
    5. 5
      Xenon
      149
  • Tell a friend

    Love Neowin? Tell a friend!