Created
September 7, 2012 00:12
-
-
Save pythonjunkie/3661720 to your computer and use it in GitHub Desktop.
Generate Unique Id
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
def unique_id(): | |
return os.urandom(10).encode('hex') | |
print " Printing Unique_id" | |
a=unique_id() | |
print a | |
OR | |
import uuid | |
print uuid.uuid4() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment