Reputation: 17933
In python how can a UUID be created with all zero values?
There is a similar question that is asked and answered for java, this question is specific to python.
Upvotes: 13
Views: 7625
Reputation: 311228
You can use the UUID class, specifically, create it from the int 0:
UUID
int
0
import uuid zero_uuid = uuid.UUID(int = 0)
Upvotes: 6
Reputation: 13589
According to the docs:
import uuid uuid.UUID(int=0) # UUID('00000000-0000-0000-0000-000000000000')
Upvotes: 23