diff options
Diffstat (limited to 'mkpw.py')
| -rwxr-xr-x | mkpw.py | 18 |
1 files changed, 7 insertions, 11 deletions
@@ -15,6 +15,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. +from secrets import choice +from argparse import ArgumentParser + WORDS = [ "abacuss", "abdomens", @@ -7993,19 +7996,12 @@ WORDS = [ "zooms", ] -import secrets -from argparse import ArgumentParser - argparser = ArgumentParser() -argparser.add_argument("-l", "--length", type=int, default=7) -args = argparser.parse_args() -choices = [] +argparser.add_argument("-l", "--length", type=int, default=7) -for _ in range(length): - word = secrets.choice(WORDS) - choices.append(word) +args = argparser.parse_args() -password = "-".join(c for c in choices) +pw = "-".join(choice(WORDS) for _ in range(args.length)) -print(password) +print(pw) |
