On Sun, Jun 6, 2010 at 10:47 PM, joblack <johannes.bl...@gmail.com> wrote: > I'm trying to get the first MAC address from the ipconfig /all output. > Unfortunately you can't just search for Physical Address because the > name is only valid in the English Windows version.
> Any ideas? (accidentally sent original to Johannes only) This filters out all the false positives on my machine (Windows 7 x64 English): import subprocess import re p = subprocess.Popen('ipconfig /all', shell = True, stdout=subprocess.PIPE) p.wait() rawtxt = p.stdout.read() print rawtxt p = re.findall(r'\s([0-9A-F-]{17})\s',rawtxt) print p Tim -- http://mail.python.org/mailman/listinfo/python-list