[Q]:Generate Unique ID's

drs drs at ecp.cc
Fri May 23 17:51:58 EDT 2003


>>> import pythoncom
>>> str(pythoncom.CreatGuid())
'{753F0F8A-1F4D-49F2-B177-2D2C2E611AB9}'

-d

<achrist at easystreet.com> wrote in message
news:3ECE8494.5A6EA6EB at easystreet.com...
> I'd like to generate unique identifiers for database items,
> sort of like the ID's that MS uses for COM.  My purpose is
> to have unique ID's (across multiple [distributed] installations of
> a program), so that databases can be combined, copied, carried off,
> re-acquinted, compared, re-synchronized, etc, with some prayer
> of not being totally munged.
>
> Is there anything in the standard Python libs to generate an ID
> like those that Windows uses, which are guaranteed to be unique
> over all instances of everything, forever, no exceptions?  How
> about an easy call to Windows (if I don't care about cross-platform)
> to have it generate one for me?  As this might happen every time
> a user presses enter, maybe even several times on some updates,
> it would be nice if it never took more than (e.g.) 0.1 secs or so.
>
>
> Al






More information about the Python-list mailing list