MeVisLab / pythonqt

Dynamic Python binding for Qt Applications
https://mevislab.github.io/pythonqt/
GNU Lesser General Public License v2.1
251 stars 89 forks source link

ask for help #208

Closed gaosh97 closed 6 months ago

gaosh97 commented 6 months ago

Can I run python file in c++ function with PythonQt, my python file like this test.txt

usiems commented 6 months ago

Sorry I didn't answer earlier: You can run a Python file with PythonQt, but you don't need PythonQt for that. You can initialize a normal Python interpreter in your code and tell it to compile and execute your code. PythonQt doesn't make it that much easier to do that. What PythonQt is good at is making your own C++ objects available in Python. What it is very good at is making QObjects (the standard interface object of the Qt framework) available in Python.