Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How i import python file to qml.
i have a python file ( this python file can speech recognition). i want to import .py file to my main.qml. i want to send text to qml file. how ?
@turkey You can't import Python code into QML. QML is not Python
@jsulm i dont want import python code. i want to import python file. like js. for example we can add any js file as "import abcdef.js as Abcds" format like this. but im asking for .py file how ?
KroMignon last edited by
i dont want import python code. i want to import python file. like js. for example we can add any js file as "import abcdef.js as Abcds" format like this. but im asking for .py file how ?
.pyis Python code, this is not possible to import in QML
you can NOT import any
.pyin QML. I don't know why you want to do it, but you have to found another way.
@KroMignon thank you for full of information answer. i want to do speech recognition in qml. There is no such feature directly in qml. Voice recognition can be done with python. I thought that if I could recognize voice with python and send data to qml, the problem would be solved.
@turkey As already said: it is not that easy as QML and Python are two completely different things. You will need to integrate your QML and Python code (to communicate between QML and Python), see the link I posted.