Prev: Is it possible to store data in a Python file in a way similar to Ruby's __END__ section?
Next: Is it possible to store data in a Python file in a way similarto Ruby's __END__ section?
From: Booter on 2 Apr 2010 16:14 Hello all, I am new to python ans was wondering if there was a way to get the mac address from the local NIC? Thanks for your help. Gerad
From: danmcleran on 2 Apr 2010 16:52 On Apr 2, 2:14 pm, Booter <colo.av...(a)gmail.com> wrote: > Hello all, > > I am new to python ans was wondering if there was a way to get the mac > address from the local NIC? > > Thanks for your help. > > Gerad for windows parse p.stdout.read(): import subprocess p = subprocess.Popen('ipconfig', shell = True, stdout = subprocess.PIPE) p.wait() print p.stdout.read()
From: danmcleran on 2 Apr 2010 16:55 On Apr 2, 2:52 pm, "danmcle...(a)yahoo.com" <danmcle...(a)yahoo.com> wrote: > On Apr 2, 2:14 pm, Booter <colo.av...(a)gmail.com> wrote: > > > Hello all, > > > I am new to python ans was wondering if there was a way to get the mac > > address from the local NIC? > > > Thanks for your help. > > > Gerad > > for windows parse p.stdout.read(): > > import subprocess > > p = subprocess.Popen('ipconfig', shell = True, stdout = > subprocess.PIPE) > > p.wait() > > print p.stdout.read() sorry, posted too soon. looks like this is for ip address only.
From: Irmen de Jong on 2 Apr 2010 16:59 On 2-4-2010 22:55, danmcleran(a)yahoo.com wrote: > On Apr 2, 2:52 pm, "danmcle...(a)yahoo.com"<danmcle...(a)yahoo.com> > wrote: >> On Apr 2, 2:14 pm, Booter<colo.av...(a)gmail.com> wrote: >> >>> Hello all, >> >>> I am new to python ans was wondering if there was a way to get the mac >>> address from the local NIC? >> >>> Thanks for your help. >> >>> Gerad >> >> for windows parse p.stdout.read(): >> >> import subprocess >> >> p = subprocess.Popen('ipconfig', shell = True, stdout = >> subprocess.PIPE) >> >> p.wait() >> >> print p.stdout.read() > > sorry, posted too soon. looks like this is for ip address only. Actually you can get more info including the MAC address when you pass the /all switch. -irmen
From: danmcleran on 2 Apr 2010 16:58
On Apr 2, 2:52 pm, "danmcle...(a)yahoo.com" <danmcle...(a)yahoo.com> wrote: > On Apr 2, 2:14 pm, Booter <colo.av...(a)gmail.com> wrote: > > > Hello all, > > > I am new to python ans was wondering if there was a way to get the mac > > address from the local NIC? > > > Thanks for your help. > > > Gerad > > for windows parse p.stdout.read(): > > import subprocess > > p = subprocess.Popen('ipconfig', shell = True, stdout = > subprocess.PIPE) > > p.wait() > > print p.stdout.read() try this instead: import subprocess p = subprocess.Popen('ipconfig /all', shell = True, stdout = subprocess.PIPE) p.wait() print p.stdout.read() |