Skip to content

Commit

Permalink
password generator
Browse files Browse the repository at this point in the history
  • Loading branch information
MidCheck committed Aug 1, 2020
1 parent 43bc978 commit bc4f43b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions gen_pass.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from random import choice
import string
import sys

def gen_password(length=8, chars=string.ascii_letters+string.digits):
return ''.join([choice(chars) for i in range(length)])

if __name__ == '__main__':
if not len(sys.argv) < 2:
if isinstance(sys.argv[1], str):
print(gen_password(int(sys.argv[1])))
sys.exit()

print("Usage: python3 gen_pass LEN")

0 comments on commit bc4f43b

Please sign in to comment.