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


Groups > comp.lang.python > #63840

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!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 <rosuav@gmail.com>
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> <BLU0-SMTP4386E5DFE51C2E3BD49827591B20@phx.gbl> <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 <rosuav@gmail.com>
Cc "python-list@python.org" <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 <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.5414.1389631648.18130.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Tue, Jan 14, 2014 at 2:42 AM, William Ray Wing <wrw@mac.com> 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

Back to comp.lang.python | Previous | NextPrevious 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