Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!ecngs!feeder2.ecngs.de!novso.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'explicitly': 0.05; 'linux,': 0.07; 'arguments': 0.09; 'instance.': 0.09; 'skip:/ 10': 0.09; 'subject:How': 0.10; 'cc:addr:python-list': 0.11; 'jan': 0.12; "(it's": 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'spawn': 0.16; 'stored.': 0.16; 'subject:port': 0.16; 'wing': 0.16; 'wrote:': 0.18; 'command': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; "i've": 0.25; 'header :In-Reply-To:1': 0.27; 'am,': 0.29; "doesn't": 0.30; 'message- id:@mail.gmail.com': 0.30; '(which': 0.31; 'ray': 0.31; "user's": 0.31; 'run': 0.32; 'running': 0.33; 'but': 0.35; 'received:google.com': 0.35; '14,': 0.36; 'subject:?': 0.36; 'default': 0.69; 'special': 0.74; 'subject:get': 0.81; 'william': 0.81; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=GlIzqaKkTaHvh06Gb6On7SoVbUZh0OLDBTcbnbLrkeI=; b=p1Mv2LkJj8TjBn63gYCdDB5gD+L2vPuZcBe8cSOwldILY+D89cpBeYuLvVNPn7/8ge p206V6pSQ2CfcR+ksW76qu34kTn+IDzs5UAsHfqtzKSe+gsSp/7njQmyPfgmUXs2iU/Z DgMClTFTEObisBbm7VKauYXWX5CDYI6QounBWvZ13qb9mPUlXRU7Y+pjSpJr1lXKnQqA /7bGEwaip+OpcFlRlJPI2TpPM/vRZd8HC26EbykXKjKd066JO7/g8h7t6agc8XPOP5iJ wmQPojNSPf9r+bZK+/RR00iMNwMQw/h2mY99Mw044ZgRNOHZclY20SbJJz+FHppe1vik NFrg== MIME-Version: 1.0 X-Received: by 10.68.108.194 with SMTP id hm2mr31072531pbb.22.1389631644770; Mon, 13 Jan 2014 08:47:24 -0800 (PST) In-Reply-To: <8B27ECD8-C6DB-414F-A76D-49B5E3DDD7E5@mac.com> References: <6a5ceb3f-021d-4acc-b618-ce53530fa2dd@googlegroups.com> <52D1729B.7050906@gmail.com> <8B27ECD8-C6DB-414F-A76D-49B5E3DDD7E5@mac.com> Date: Tue, 14 Jan 2014 03:47:24 +1100 Subject: Re: How to get Mac address of ethernet port? From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1389631648 news.xs4all.nl 2969 [2001:888:2000:d::a6]:54470 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:63840 On Tue, Jan 14, 2014 at 2:42 AM, William Ray Wing wrote: > The one I've used is to spawn a subprocess and run the "ifconfig" command with no arguments (which doesn't require any special privileges). Very small caveat: On some systems, running ifconfig doesn't require privileges, but it's not in the unprivileged user's default path (it's in root's path though). I've seen this on Debian Linux, for instance. So you may need to explicitly call /sbin/ifconfig or whereever it's stored. ChrisA