• 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

    • VR is dead on the PS at this rate, sales just aren't there. Way more VR push on the PC, even Sony knows this and that's why they added PC support to the PSVR.
    • Borderlands series, Rematch, Broken Arrow, and more get Nvidia GeForce NOW support by Pulasthi Ariyasinghe Another Nvidia GeForce NOW games update has arrived, meaning subscribers now have even more games to jump into via the cloud if they own a copy. The latest wave touts 13 more games, and that includes the Borderlands franchise from Gearbox, Remedy's brand-new cooperative shooter FBC: Firebreak, and more. With the fourth entry now on the way, for those who have yet to jump into Gearbox's wacky looter shooter universe, Borderlands, Borderlands 2, Borderlands 3, and even Borderlands: The Pre-Sequel are now a part of GeForce NOW. The Sifu developer's rule-less soccer experience, Rematch, has also been released to standard edition owners today. With the latest update, for owners of the game or PC Game Pass subscribers, it is also accessible via the cloud on GeForce NOW. Here are the games announced for the program this week: REMATCH (New release on Steam, Xbox, available on PC Game Pass, June 16) Broken Arrow (New release on Steam, June 19) Crime Simulator (New release on Steam, June 17) Date Everything! (New release on Steam, June 17) FBC: Firebreak (New release on Steam, Xbox, available on PC Game Pass, June 17) Lost in Random: The Eternal Die (New release on Steam, Xbox, available on PC Game Pass, June 17) Architect Life: A House Design Simulator (New release on Steam, June 19) Borderlands Game of the Year Enhanced (Steam) Borderlands 2 (Steam, Epic Games Store) Borderlands 3 (Steam, Epic Games Store) Borderlands: The Pre-Sequel (Steam, Epic Games Store) METAL EDEN Demo (Steam) Torque Drift 2 (Epic Games Store) As always though, keep in mind that unlike subscription services like Game Pass, a copy of a game must be owned by the GeForce NOW member (or at least have a license via PC Game Pass) to start playing via Nvidia's cloud servers.
    • WHAT? First of all, Azure, literally, runs on THE LINUX KERNEL. I know, right? Windows is easier to develop drivers? This must be the joke of the century! Developing drivers on Linux, you can interact with low level implementation straight to the core. You can build and test them with standard tools like GCC and Make, no need for a full blown IDE or SDKs, only a kernel header and a Makefile. You can load/unload drivers dynamically, without rebooting, which makes debugging MUCH easier. You don't need to sign drivers, unlike Windows, even for local testing. And a ton of other conveniences. "There is no way a Linux distribution can compete against Windows". Literally, SteamOS competes against Windows on handhelds, playing games WRITTEN for Windows, BETTER than Windows. "DirectX is the most powerful API"? Really? Vulkan provides more low level control, less overhead, scales better with more threads, it's cross platform and extensible. How, exactly, is "DirectX the most powerful API"?
    • It's easier for the console market to pull in more revenue when they're prices are higher compared to the PC where games often come out cheaper than their console versions or go on sale quicker. Having said that, I'm not going to be paying $70 or $80 for a game, regardless of the platform it's on. Revenue aside, because raising prices on consoles skew things when the prices on the PC often stay around the same levels, it's been shown that the PC market is growing while the console market is overall flat. PC will pass consoles soon dropping them into 3rd place. And the PS5 being on track to pass the PS4 doesn't say much, if the console market was actually still growing Sony would've passed the PS2 as it's best selling console with the PS3, and the PS4 would've outsold both and so on. That's not happening. It took Nintendo to release a totally different hybrid system with the Switch to inject some new life into the "console" market. Even then it's pushed as a handheld first and the majority who buy it do so because it's portable and at a good price.
    • As with the rest of the misleading statement you made about SteamOS "limitations", you are wrong again. No, the XBOX does NOT run "slimmed down and modified Windows". It runs a HEAVILY modified version of the Hyper-V hypervisor, called "Nanovisor" and 2 VM partitions. One for games, one for the apps. It is NOT Windows, it can NOT run Windows games and its DirectX components are NOT the same as for Windows, they are customized for XBOX.
  • Recent Achievements

    • First Post
      MikeK13 earned a badge
      First Post
    • One Month Later
      OHI Accounting earned a badge
      One Month Later
    • Week One Done
      OHI Accounting earned a badge
      Week One Done
    • First Post
      Thornskade earned a badge
      First Post
    • Week One Done
      Higante88 earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      717
    2. 2
      ATLien_0
      273
    3. 3
      Michael Scrip
      203
    4. 4
      +FloatingFatMan
      182
    5. 5
      Steven P.
      128
  • Tell a friend

    Love Neowin? Tell a friend!