Don't use commandPort, use a listener python socket script in your maya or batch session to listen and just exec() the strings your sending.
On Oct 13, 2012, at 10:33 AM, Ali Khanbabaei <ali.kh....@gmail.com> wrote: > hi guys. > when i run this script ,i get this error : ocket.error: [Errno 10061] No > connection could be made because the target machine actively refused it > what i should to do? > > import socket > HOST ="192.168.1.2" #destination IP > PORT =7000 > ADDR=(HOST,PORT) > client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > client.connect(ADDR) > MyMessage = 'polyCube()' > client.send(MyMessage) > data = client.recv(1024) > client.close() > print 'The Result is %s'%data > /////////////////////////////// > explain: > -os : 7 > -pyVer :2.6 > -mayaVer:2013 > -firewall in client and server is off > -run commandPort -n ":7000" in client > -- > view archives: http://groups.google.com/group/python_inside_maya > change your subscription settings: > http://groups.google.com/group/python_inside_maya/subscribe -- view archives: http://groups.google.com/group/python_inside_maya change your subscription settings: http://groups.google.com/group/python_inside_maya/subscribe