[PyQt] Qt scripting framework

eliben eliben at gmail.com
Fri Feb 13 16:06:03 GMT 2009




Frédéric Mantegazza-2 wrote:
> 
> 
> Is there an advantage using the Qt scripting framework in PyQt, as it
> should be possible to use python as scripting feature?
> 
> Is there some example code to show how one could allow users to script
> some parts of an application?
> 
> Thanks,
> 
> --
>    Frédéric
> 
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
> 
> 

Hi Frédéric,

I was also wondering about the scripting capability. It surely makes lots of
sense for C++ applications written with Qt - scripting them in a more
accessible language like Javascript is a good idea for complex apps.
However, in PyQt we have Python built in - you can dynamically load, compile
and execute Python code, and exposing a Python API to Python is far simpler
and more natural than exposing a Python API to Javascript (or a C++ API to
Javascript).

As for examples, the PyQt distributions contains an examples directory.
There in script/ is a smallish example of JS scripting using the scripting
framework, so you may use it to get started.

Eli



-- 
View this message in context: http://www.nabble.com/Qt-scripting-framework-tp21978534p21999380.html
Sent from the PyQt mailing list archive at Nabble.com.




More information about the PyQt mailing list