Listing 4: YAMI client in Python.

# a simple YAMI client in Python. this code can be used also in the
# interactive Python console

from YAMI import *

a = Agent(12341)
a.domainRegister('someDomain', '127.0.0.1', 12340, 2)

msg = a.send('someDomain', 'calculator', 'multiply', [5, 6])
msg.wait()

if msg.getStatus() == eReplied:
        results = msg.getResponse()
        print 'the result is:', results[0]
else:
        print 'the message was not replied correctly'