Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #63707

Re: How to get Mac address of ethernet port?

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 <skip.montanaro@gmail.com>
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 <CAPTjJmo8A6aUE2Gn-S=X3Gh6fRuZbVT1PZzPWbxLHSKN2K7e=A@mail.gmail.com>
References <6a5ceb3f-021d-4acc-b618-ce53530fa2dd@googlegroups.com> <BLU0-SMTP4386E5DFE51C2E3BD49827591B20@phx.gbl> <CAPTjJmo8A6aUE2Gn-S=X3Gh6fRuZbVT1PZzPWbxLHSKN2K7e=A@mail.gmail.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 <skip@pobox.com>
To Chris Angelico <rosuav@gmail.com>
Content-Type text/plain; charset=UTF-8
Cc "python-list@python.org" <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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5332.1389452592.18130.python-list@python.org> (permalink)
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

Show key headers only | View raw


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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to get Mac address of ethernet port? Sam <lightaiyee@gmail.com> - 2014-01-11 06:26 -0800
  Re: How to get Mac address of ethernet port? Andriy Kornatskyy <andriy.kornatskyy@live.com> - 2014-01-11 16:35 +0200
    Re: How to get Mac address of ethernet port? "James Harris" <james.harris.1@gmail.com> - 2014-01-11 15:54 +0000
      Re: How to get Mac address of ethernet port? Roy Smith <roy@panix.com> - 2014-01-11 11:29 -0500
        Re: How to get Mac address of ethernet port? Chris Angelico <rosuav@gmail.com> - 2014-01-12 08:40 +1100
          Re: How to get Mac address of ethernet port? Roy Smith <roy@panix.com> - 2014-01-11 16:55 -0500
            Re: How to get Mac address of ethernet port? Chris Angelico <rosuav@gmail.com> - 2014-01-12 09:08 +1100
            Re: How to get Mac address of ethernet port? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-01-12 11:22 -0500
  Re: How to get Mac address of ethernet port? Chris Angelico <rosuav@gmail.com> - 2014-01-12 01:38 +1100
  Re: How to get Mac address of ethernet port? Chris Angelico <rosuav@gmail.com> - 2014-01-12 01:52 +1100
  Re: How to get Mac address of ethernet port? Skip Montanaro <skip@pobox.com> - 2014-01-11 09:03 -0600
  Re: How to get Mac address of ethernet port? Michael Torrie <torriem@gmail.com> - 2014-01-11 09:34 -0700
    Re: How to get Mac address of ethernet port? Sam <lightaiyee@gmail.com> - 2014-01-11 17:25 -0800
  Re: How to get Mac address of ethernet port? William Ray Wing <wrw@mac.com> - 2014-01-13 10:42 -0500
  Re: How to get Mac address of ethernet port? Chris Angelico <rosuav@gmail.com> - 2014-01-14 03:47 +1100

csiph-web