There is a difference between the logging I/O output and the return value of the function. When I write a function like this:
def add(x, y):
z = x + y
print "OUTPUT:", z
return z
I set the OUTPUT go to the Maya script editor, and the value 3 is returned in the commandPort stream. But one thing to be aware of is that if your command has multiple statements separated with a semicolon, then None will be returned:
$ echo '1+1 ; 2+2' | nc localhost 8010
None
$ echo '2+2' | nc localhost 8010
4
So if you need to send a bunch of logic, you might need to wrap it into a function and then have it return your output.
TIA
--
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/1e7024ea-354e-47a2-a9ca-05bb91c57149%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.