summaryrefslogtreecommitdiff
path: root/mkpw.py
diff options
context:
space:
mode:
Diffstat (limited to 'mkpw.py')
-rwxr-xr-xmkpw.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/mkpw.py b/mkpw.py
index 41d776f..cf3c633 100755
--- a/mkpw.py
+++ b/mkpw.py
@@ -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)