I would not imagine that qml has a specific method to execute python
scripts, however the underlying C++ is the same as normal Qt
You can for instance launch any process by using QProcess, so just need
to define a class that does that and call it in your qml bit
eg (off the top of my head - not for cut and paste)
class pyLauncher : public QObject
{
Q_OBJECT
public:
pyLauncher(QWidget *parent);
virtual ~pyLauncher() {};
void launch(QString& str);
private:
QProcess *proc;
}
pyLauncher :: pyLauncher(QWidget *parent)
{
proc = new QProcess(parent);
}
void pyLauncher :: launch(QString& str);
{
QString s;
s = "python " + str;
proc->start(s);
}
> Tab {
> id: python tab
> title: qsTr("execute Python")
>
> Button {
> id: mybtn
> text: "press"
> onClicked: {
> mypyLauncherInstance->launch("example.py");
> }
> }
regards