How to make a GUID with plain python

Michael Lausch mla at 1012surf.net
Thu Dec 21 05:48:54 EST 2000


gogo at bluedynamics.com (Georg Gogo. BERNHARD) writes:

> Hello!
> 
> I am looking for a way to create a global unique identifier / UUID
> with python. I found a way to do this with ActivePython in Windows,
> but I need a solution for other platforms, too. (In ActivePython one
> can use >>> pythoncom.CreateGuid <<< to get a global unique
> identifier.)
> 
> The GUIDs use the MAC adress of the machine they are created at in
> their algorithm. I start to think that this can not be done in python,
> but I still hope that I am wrong in that point.


use os.popen('/sbin/ifconfig -a','r') and regexp match the output for
mac addresses.

-- 
"Reality is that which, when you stop believing in it, doesn't go away".
                -- Philip K. Dick



More information about the Python-list mailing list