How to find MAC address and uids?

Marcin Jurczuk mj-usunto at tkb.pl
Wed Nov 10 07:14:10 EST 2004


On 2004-11-10, Daniel T. <postmaster at earthlink.net> wrote:

> 1) How can I programatically find the MAC address of the machine? Is it 
> stored in a file I can look into? (MacOS X)
What is syntax of this file ??

> 2) If I have a user name in a string how do I get his UID?

>>> import pwd
>>> pwd.getpwnam('spock')
('spock', 'x', 100, 101, '', '/export/home/spock', '/bin/bash')
>>> pwd.getpwnam('spock')[2]
100
>>>


-- 
Marcin Jurczuk, NIC-HDL: MJ1679-RIPE



More information about the Python-list mailing list