I noticed that doing
print() from a PyObjC application behaves differently when run from python 2 or python 3.
I tried to make a standalone .app with py2app from the example "HelloWorld.py" script:
The setup.py looks like this:
from setuptools import setup setup( app=["HelloWorld.py"], setup_requires=["py2app"], )
Now, if I build it with Python 3.5.2 (downloaded from python.org), using pyobjc 3.2.1 (released today) and the latest py2app, the output of print() is only shown in the Console.app only when the application is closed.
Similarly, If I run it from the Terminal.app by doing
dist/HelloWorld.app/Contents/MacOS/HelloWorld, the output is only printed after quitting.
However, if I manually do
sys.stdout.flush() after each print, then I see the output immediately after clicking the buttons, while the app is still running.
The issue does not occur when compiling the same code with the system python 2.7.10 and same version of pyobjc 3.2.1 (in a virtualenv).
Thank you for your support.