Just wanted to confirm that I'm not doing something wrong, or that there
isn't something in our startup process that's making this fail... but is it
True that the commandPort command doesn't work if run from inside of
mayapy?  (Note that it DOES work from "maya -prompt")...

Here's the code I was using to test:

To start:

port = XXX
import pymel.core  # just to startup maya
import maya.cmds as cmds
cmds.commandPort(n=":%s" % port, sourceType='python')
print "socket opened on port %s" % port


To connect:

import socket
port = XXX
mayaSock = socket.socket()
mayaSock.settimeout(.5)
mayaSock.connect(('localhost', port))
try:
    mayaSock.send(r'print "hello from the outside world!\n";')
    mayaSock.send(r'polyCube();')
finally:
    mayaSock.close()

-- 
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/CAAssL7Z4Y5R6EsNmFra9LkV%2BmmubTYXEnXa6JGaSBXjv8%2Bv_Bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to