well, if using python, from this page,
use the first answer, I got the first IP,
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
use the second answer, I got the second IP,
it is not uncommon for an adapter to have multiple IPs.
maybe return all IPs , on return only the "primary" IP (the one with a default route).