Lance lbrannma at
Sun Oct 20 01:24:22 CEST 2002

Thanks all for your advice. Magnus Lycka provided the solution, for Windows

If you by MacID mean MAC address, or Media Access Control
address, i.e. the hardware address in the network card,
this could work on Win 2000 for instance. The solution on
unix/linux is very similar. Please note that some machines
have several network cards (or none) which makes life more

 >>> import os, re
 >>> pattern = re.compile(r'\w\w-\w\w-\w\w-\w\w-w\w-\w\w')
 >>> text = os.popen('ipconfig /all').read()
 >>> m =

"Lance" <lbrannma at> wrote in message
news:ur2ok51jlan72f at
> Hi All,
> I'd like to retrieve a computer's hostid. Does anyone know how to do this?
> Thanks in advance.
> Lance

More information about the Python-list mailing list