Last active
April 20, 2017 15:46
-
-
Save bofm/82a87f08d5d5415591fa to your computer and use it in GitHub Desktop.
python generate random string
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
# Python 3 | |
import random | |
import string | |
''.join(random.choice(string.ascii_letters + string.digits + '#$-=_') for n in range(32)) | |
# Python 2 | |
import random | |
import string | |
''.join([random.choice(string.ascii_letters + string.digits + '#$-=_') for n in xrange(32)]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment