Thanks to Chris and Ben. Your suggestions were slightly different but both worked equally well, although I don't understand how that can be so.
> struct.pack('256s', ifname[:15].encode('ascii')) > struct.pack('256s', ifname.encode('ascii')) I was looking for a reliable way to determine the IP addy for a given network adapter. That is what the code does but I don't understand how it does it either. Thanks again. I will continue to research and study the code in the hope I will understand it. -- <Wildman> GNU/Linux user #557453 The cow died so I don't need your bull! -- https://mail.python.org/mailman/listinfo/python-list