Created
October 27, 2015 14:10
-
-
Save therollingtester/de9894e9ee24291f235c to your computer and use it in GitHub Desktop.
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 | |
from string import letters | |
def randstr(n): | |
return ''.join(random.choice(letters) for i in range(n)) | |
# return ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(N)) | |
if __name__ == '__main__': | |
import sys | |
n = int(sys.argv[1]) if len(sys.argv) == 2 else 100 | |
print randstr(n) | |
## python randstr.py 100000 | pbcopy | |
## python viktor.py viktor 100 | pbcopy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment