git » pymisc » master » tree

[master] / samples / pickle_rpc / c1.py

import pickle_rpc
cli = pickle_rpc.Remote('localhost')

print cli.f(1, a = 2)
print len(cli.long(10000))

try:
	cli.exc()
except KeyError, info:
	print 'successfuly caught', KeyError, info

print cli.test2_i.t1.method("hi!", 1, 2, 3)

# the following causes an error unpickling on the server side, and it's useful
# for testing that code path
#class E(Exception): pass
#cli.f(E)