Hello,
I am trying to use xml-rpc to be able to run some simulations
remotely. I am running into a problem with the transfer of numpy
arrays. my server code looks like:
#!/usr/bin/env python
def again(x): # test out the sending of data
return [x,x]
from SimpleXMLRPCServer import SimpleXMLRPCServer
SimpleXMLRPCServer.allow_reuse_address = 1
server = SimpleXMLRPCServer(("", 8000))
server.register_function(again)
try:
print "Serving..."
server.serve_forever() # Start the server
finally:
print "done."
server.server_close()
my client code looks like:
import numpy
from xmlrpclib import ServerProxy
server=ServerProxy('http://localhost:8000')
server.again(5) # this works
b=numpy.random.rand(5,5)
server.again(b) # this gives an error
this gives the error:
participants (6)
-
Brian Blais
-
Lisandro Dalcin
-
Robert Kern
-
Sebastien Binet
-
Uwe Schmitt
-
Vincent Schut