OSC has the concept of an message address that is distinct from the network address of the device to which you're connecting. The idea is that the message you are sending could be routed to one of many different handlers at the other end of the network connection. Each handler has its own address which is usually designated with a '/' prefix.
Using the same client code from the question you referenced:
import OSC
c = OSC.OSCClient()
c.connect(('127.0.0.1', 57120)) # localhost, port 57120
oscmsg = OSC.OSCMessage()
oscmsg.setAddress("/startup")
oscmsg.append('HELLO')
c.send(oscmsg)
First, run this server code:
import OSC
def handler(addr, tags, data, client_address):
txt = "OSCMessage '%s' from %s: " % (addr, client_address)
txt += str(data)
print(txt)
if __name__ == "__main__":
s = OSC.OSCServer(('127.0.0.1', 57120)) # listen on localhost, port 57120
s.addMsgHandler('/startup', handler) # call handler() for OSC messages received with the /startup address
s.serve_forever()
Then run the client from a different terminal. On the server side you should get something like:
OSCMessage '/startup' from ('127.0.0.1', 55018): ['HELLO']
The best way to get more insight into how to use pyOSC is to just read the source. It's all in OSC.py and not too long. There is a test method at the bottom of the file that gives a fairly detailed examples of how to use most, if not all, of the protocol functionality.