Many people do not understand, learning these cold functions basically can not be used, or what is more useful, in fact, there is a lot of use, such as today to introduce the uuid module, to be able to generate a truly random number, but also to the database to generate a unique ID, a lot of places can be used, interested in small partners, you can follow the editor, a serious learning to understand! La.
Module Installation:
pip install uuid
Module Import:
import uuid
Usage Scenarios:
1, can generate time stamp
2. Random numbers can be generated
Usage:
import uuid uuid.uuid3(uuid.NAMESPACE_DNS, '') UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e')
Instance Extension
#-*- encoding: gb2312 -*- import uuid print uuid.uuid1() print uuid.uuid3(uuid.NAMESPACE_DNS, 'testme') print uuid.uuid4() print uuid.uuid5(uuid.NAMESPACE_DNS, 'testme')
to this article on the python uuid module example analysis of the article is introduced to this, more related python uuid module is what content please search for my previous articles or continue to browse the following related articles I hope you will support me in the future more!