Last active
May 20, 2018 01:51
-
-
Save milnomada/0e40a0c55a32a5249abeddfdb366f7f7 to your computer and use it in GitHub Desktop.
Python password generator
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 sys,random | |
size=8 | |
if len(sys.argv)>1: | |
try: | |
size=int(sys.argv[1]) | |
except ValueError: | |
pass | |
charset="!?#$%&*()_abcdefghijklmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
print("".join(random.sample(charset,size))) | |
# run: python ge.py 16 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment