One thing that would help, to start, is make sure you are using the
pickleOutput option when you open the commandPort. That will make it easier
to receive values. Then, if you make sure to send just a single operation,
you should get back the result:

import cPickle

sock.send("import os")
#...
sock.send("os.getpid()")
ret = sock.recv(BUF)print cPickle.loads(ret)

​



On Fri, Jun 5, 2015 at 5:59 AM Nicholas Yue <[email protected]> wrote:

> Hi,
>
>      Newbie question.
>
>      So far, I have used an external python application to send commands
> to Maya and it works. (doing simple things, create geometry etc)
>
>      What additional steps do I need to do in order to query the results
> from python command that was sent over ?
>
>      I sent over a 'import os\npid=os.getpid()\n'
>
>      I'd like to get the resulting pid value.
>
>      Is there a basic example I can learn from for such query ?
>
> Cheers
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/557091F0.5010808%40gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2v4%3DcwYoqi0oDVM4mte7_2fUeW_DEGE37QO9RVhV_7HQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to