> I am exporting maya scene using couple of functions written in pymel.
> These functions have print statement to print the information in
> script editor as soon as they are called. Problem is that all the
> print statements appears in the last when every thing is finished.

that's strange. can you post some example code demonstrating this.

> By the way how do print on "output window" using pymel?

maya overwrites sys.stdout and sys.stderr with their own streams that  
redirect to to the script editor. luckily, python keeps the originals  
of these streams as sys.__stdout__ and sys.__stderr__. since these are  
file streams, you can write to them as any file:

import sys
sys.__stdout__.write( "this is some awesome output\n" )

however, a better way to do this is to use a special shorthand for  
redirecting the print statement to an alternate stream

print>>sys.__stdout__, "this is some awesome output"

then it's a simple find and replace to change where you're printing  
to. (also, notice i needed to write a newline in the first example).

-chad


--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---

Reply via email to