thp / pyotherside

Python Bindings for Qt 5 and Qt 6. Allows you to access a CPython 3 interpreter directly from your Qt QML user interface code.
https://thp.io/2011/pyotherside/
Other
364 stars 49 forks source link

Output of Python's print() function is not shown in QtCreator #83

Closed drs251 closed 5 years ago

drs251 commented 7 years ago

I'm having this really strange error, where when I print something from a Python script with pyotherside, it does not show up on the "Application Output" tab in QtCreator 4.3.1. I've used atexit_example.qml from the examples directory to confirm this behavior on Windows 10 with MSVC2015 64bit and Anaconda 4.4.0, as well as on Ubuntu 17.04 with the included gcc and python, in both cases with Qt 5.9.1. The output I expect shows up if I run my program form a terminal in Ubuntu, but not on Windows. I am not getting any error messages in any case. I would assume that QtCreator is the natural IDE for QML projects, so it would be great if this error could be fixed (if it is an error), or if the documentation could explain how to set up QtCreator properly.

EDIT: I've noticed I can get around the problem by adding CONFIG += console to the project file, so that it runs in the terminal. I have the suspicion that the error happens when QML and Python are trying to print messages at the same time, and the terminal is better able to handle this somehow.