Created
July 19, 2014 15:44
-
-
Save whtsky/c7d5f7a7b86b89fbb37e to your computer and use it in GitHub Desktop.
Generate random string in Python
This file contains hidden or 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 random | |
s = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789^!\\$%&/()=?{[]}+~#-_.:,;<>|\\' | |
def create(): | |
return ''.join([random.choice(s) for _ in range(16)]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment