Python in QT
-
Hi,
I have a python script:
#!/usr/bin/python
print('hello world')I want to use QT for debugging and running this script. Something like I would do for example with PyCharm. Is it possible? If so, how?
I have configured the "Run configuration" under Projects tab, but without success. I am completely new so I do not know exactly how to configure the debugger neither how to run the script.Any assistance is appreciated.
Thanks
-
@GSuarez said in Python in QT:
I want to use QT for debugging and running this script
Qt is a C++ framework.
Do you maybe mean QtCreator which is a C++ IDE?
If so, then I don't think you can use QtCreator to debug Python scripts as it is a C++ IDE, not Python. -
Hi
If you use pyside2 bindings then i think you can now debug also in Creator.
https://doc.qt.io/qtforpython/gettingstarted.html
https://wiki.qt.io/Qt_for_Python/GettingStarted -
@jsulm said in Python in QT:
If so, then I don't think you can use QtCreator to debug Python scripts as it is a C++ IDE, not Python.
Although I'm not sure, I think @mrjj is right on this: since some release a while ago, I believe Creator now supports PySide2 editing and debugging(?)
-
@JonB
It says so in the last link but
Qt Creator 4.0+ can be used to open the PySide and Shiboken CMakeLists.txt files as projects, and thus provide usual IDE features for developing PySide - project file navigation, code completion (C++ only), following symbols under cursor (C++ only), syntax highlighting, locator usage, debugging, etc.so it sounds like it can but i did not try it as it uses cmake which i dont use.
-
@mrjj said in Python in QT:
code completion (C++ only), following symbols under cursor (C++ only)
Oh dear :( That's no good, we need proper Python editing support, and use of the Python debugger if it's not saying it does that. Fortunately I'm not having to do Python atm, but sounds like PyCharm is still a better bet if this is true....