Maya 2022 and output windows

281 views
Skip to first unread message

Todd Widup

unread,
May 6, 2021, 7:30:22 PM5/6/21
to python_in...@googlegroups.com
so while Maya doesnt open the output window by default now, its still there.
In the past, I used it to print info to instead of the script editor as its faster.
in python 2.7 i used sys.__stdout__.write(), which isnt used in in Python 3...so is there a way to print to the output window in Maya 2022 now?

--
Todd Widup
Creature TD / Technical Artist
todd....@gmail.com

Marcus Ottosson

unread,
May 7, 2021, 1:42:40 AM5/7/21
to python_in...@googlegroups.com

I recently asked this very same question on the Autodesk forums, and yes, the solution is to simply call flush() afterwards. :D

sys.__stdout__.write("Hello world!")
sys.__stdout__.flush()

It’s available and harmless in Python 2 as well.


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CABBPk36reADnbxD0%3DB10wJYe4pc1ED%2BWN44KVfHRiFNGzmMW4g%40mail.gmail.com.

Alok Gandhi

unread,
May 7, 2021, 8:38:21 AM5/7/21
to python_in...@googlegroups.com
At least on latest macOS Big Sur, the print to console still works without the need to use flush()

Additionally, setting the env var PYTHONUNBUFFERED to a non empty value would cause the output to go to the terminal without being buffered.

Reply all
Reply to author
Forward
0 new messages