For an application I am currently working on I decided to use HTML5 for the interface, allowing me to have a modern interface that doesn’t change in appearance when you change operating systems. Naturally I chose the webkit engine for rendering, specifically the PyQT bindings. My issue is that every time I want to call a javascript function from python, I have to do it using the messy evaluateJavaScript function.
Any alternatives I can use that allow a more direct way of calling javascript functions?
PyQt doesn’t have any wrapper that makes things easier.
You could write your own, if you want—not perfect, but a little nicer. For example, something like this (just a skeleton, not actual code):
As you can see, it’s still a bit clumsy—you have to manually create the object proxies, and there’s no way to call free functions or declare variables or anything other than call methods on objects. Some of that could be implemented, but there’s a limit to how far you can go. (Of course you can always fall back to explicit strings.)