Panda3d on android / termux: how to print()

I built panda3d on android under termux. Runs fine.

The documentation says, that output is piped to the calling script “” via socket.

panda3d is able to send errors and warnings via that pipe and I can see that in my termux bash shell.

Unfortunately, printing from inside my code (via pythons print command) doesn’t follow the same rules.

It would be very convenient, if print() or print("…", file=std.err) or something like that would work and send its results to my shell.

Anyone any idea?

This actually works for me; though Python may buffer the output, so you may need to add something like sys.stdout.flush() after your print statement to see the output immediately.

rdb, thank you very much.
It works with your hint.

My workaround was:

LOG = DirectNotify().newCategory(“myCategory”)
LOG.warning(“Log Message”)