The globally unique identifier (guid,globally unique Identifier) is also known as the UUID (universally unique Identifier).
There are UUID libraries in Python that can generate different types of UUID:
Import uuiduuid.uuid1 ()
The result is:
UUID ('f6922dc0-0c45-11e5-a62e-b8763facf5a5')
There are also UUID2,UUID3,UUID4,UUID5, but there is no uuid2 in Python.
>>>ImportUUID>>>#Make a UUID based on the host ID and current time>>>uuid.uuid1 () uuid ('a8098c1a-f86e-11da-bd1a-00112444be1e')>>>#Make a UUID using a MD5 hash of a namespace uuid and a name>>> uuid.uuid3 (UUID. Namespace_dns,'python.org') UUID ('6fa459ea-ee8a-3ca4-894e-db77e160355e')>>>#Make a random UUID>>>Uuid.uuid4 () uuid ('16fd2706-8baf-433b-82eb-8c7fada847da')>>>#Make a UUID using a SHA-1 hash of a namespace uuid and a name>>> UUID.UUID5 (UUID. Namespace_dns,'python.org') UUID ('886313e1-3b8a-5372-9b90-0c9aee199e5d')>>>#Make a UUID from a string of hex digits (braces and hyphens ignored)>>> x = uuid. UUID ('{00010203-0405-0607-0809-0a0b0c0d0e0f}')>>>#convert a UUID to a string of hex digits in standard form>>>str (x)'00010203-0405-0607-0809-0a0b0c0d0e0f'>>>#get the raw bytes of the UUID>>>x.bytes'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f'>>>#Make a UUID from a 16-byte string>>> UUID. UUID (bytes=x.bytes) UUID ('00010203-0405-0607-0809-0a0b0c0d0e0f')
More Information reference: https://docs.python.org/2/library/uuid.html
Python generates UUID