Code: Alles auswählen
In [7]: u = uuid.uuid1()
In [8]: str(u)
Out[8]: '9477da1c-ed4f-11e6-a1cf-901b0e8d499b'
In [9]: uuid.UUID(str(u))
Out[9]: UUID('9477da1c-ed4f-11e6-a1cf-901b0e8d499b')
In [10]: uuid.UUID(str(u) + 'z')
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-10-ec471a35591a> in <module>()
----> 1 uuid.UUID(str(u) + 'z')
/usr/lib/python2.7/uuid.pyc in __init__(self, hex, bytes, bytes_le, fields, int, version)
134 hex = hex.strip('{}').replace('-', '')
135 if len(hex) != 32:
--> 136 raise ValueError('badly formed hexadecimal UUID string')
137 int = long(hex, 16)
138 if bytes_le is not None:
ValueError: badly formed hexadecimal UUID string