In [7]:
import xmlrpclib, sys
import matplotlib.pyplot as plt
import numpy as np
import scipy.misc

################################# Connect to Server #################################
host, port = "127.0.0.1", 8001
server = xmlrpclib.ServerProxy("http://{0:s}:{1:.0f}".format(host, port) )

################################# Use Server's Functions #################################
image_name = "./waterfall.jpg"
image = plt.imread(image_name)
scipy.misc.imsave('client_original.jpg', np.array(image))
to_send = image.tolist() # lossless conversion to list

flipped = server.flip_image(to_send) # use server to flip the image
scipy.misc.imsave('client_flipped.jpg', np.array(flipped))

cropped = server.crop_image(to_send) # use server to crop the image
scipy.misc.imsave('client_cropped.jpg', np.array(cropped))

inverted = server.color_complement(to_send) # use server to invert the image's colors
scipy.misc.imsave('client_inverted.jpg', np.array(inverted))

In [2]:
################################# Test Help Functions #################################
print "The provided server functions are:"
for method in server.system.listMethods():
    print method

print "\nAnd the help documentation specifically for 'crop_image' is:"
print server.system.methodHelp("crop_image")


The provided server functions are:
color_complement
crop_image
flip_image
system.listMethods
system.methodHelp
system.methodSignature
system.multicall

And the help documentation specifically for 'crop_image' is:
Crop the image by the specified percentage on each side; Call with the following parameters:
crop_image(image, left=.25, right=.25, top=.1, bottom=.1)