Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.024 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'subject:How': 0.10; 'cc:addr:python-list': 0.11; 'from:addr:pobox.com': 0.16; 'from:addr:skip': 0.16; 'subject:port': 0.16; 'sender:addr:gmail.com': 0.17; 'slightly': 0.19; '>>>': 0.22; 'import': 0.22; 'cc:addr:python.org': 0.22; 'skip': 0.24; 'cc:2**0': 0.24; 'second': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; "skip:' 10": 0.31; 'received:google.com': 0.35; 'subject:?': 0.36; 'skip:u 10': 0.60; 'to:addr:gmail.com': 0.65; 'subject:get': 0.81 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=v8IZxwTQkMsLK7KTMHwAwiMpnhYh11b0P5k5LLRbTzU=; b=X2t7M3/lak/ulwhNiACqA6VY5PgH6A0a/nmjT6sqL5zTfulDZpDo/4dHcznCou51DU UWbmPZMlfhEXMQx0jKJCnNH8iz2ofSv0XrFvrv8rgLQ1iaj9L5FM5MV0Nue8dQE20Xty ABwJmPk7ku7PmX+AJg12fHas9c+Pt7EYxXJMBj3OeEukYoBWUEkS1pFRTA3uNBUnQEtf 5TJAGhfALFI3wzidZOjTSzYO2DVeeNjkcvkMZ6ESoAbIV0UyFlRlw9c8YbC7T1WwVdd0 ipOaLYgTZ5h+gN6306IpE9d77GPEM7y7qDvxpJif4lAGVLoXBK43UH4Srb6cUSWbDrsr e87Q== MIME-Version: 1.0 X-Received: by 10.43.19.66 with SMTP id qj2mr13229608icb.31.1389452584746; Sat, 11 Jan 2014 07:03:04 -0800 (PST) Sender: skip.montanaro@gmail.com In-Reply-To: References: <6a5ceb3f-021d-4acc-b618-ce53530fa2dd@googlegroups.com> Date: Sat, 11 Jan 2014 09:03:04 -0600 X-Google-Sender-Auth: SFfcM7ZtKLWe7yuTO39lh0wmrUE Subject: Re: How to get Mac address of ethernet port? From: Skip Montanaro To: Chris Angelico Content-Type: text/plain; charset=UTF-8 Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 8 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1389452592 news.xs4all.nl 2932 [2001:888:2000:d::a6]:41312 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:63707 This is slightly longer than ChrisA's second solution: >>> import uuid >>> s = "%12x" % uuid.getnode() >>> ":".join(x+y for x, y in zip(s[::2], s[1::2])) '18:03:73:cb:2a:ee' Skip