Tuesday, June 26, 2007

Generate GUID in Python running in Windows

GUID can be useful as a primary key for a databases and also for the records or rows of data that needs to be unique. There are a lot of tools that can generate a GUID but in this quickie blog, I am documenting how to generate a GUID using Python in Windows.

To generate a GUID, import the code below:

import pythoncom

_guid = pythoncom.CreateGuid
()
_guid_str = str(_guid
)
print
"%s GUID is %d long"%(_guid_str,len(_guid_str))


~ts~

No comments:

Configuring TUN/TAP virtual network interface for use with QEMU on Xubuntu 24.04

Configuring TUN/TAP virtual network interface for use with QEMU on Xubuntu 24.04 I am planning to run qemu-system-ppc to play around QEMU ...