From d36efec25f171882235f5cc1fc5926f05340fde2 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 9 Aug 2021 08:46:36 -0700 Subject: [PATCH] Use random.choices instead of random.choice in a loop. --- epubfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epubfile.py b/epubfile.py index 5f393b9..92538a6 100644 --- a/epubfile.py +++ b/epubfile.py @@ -1516,7 +1516,7 @@ setfont: DOCSTRING = betterhelp.add_previews(DOCSTRING, SUB_DOCSTRINGS) def random_string(length, characters=string.ascii_lowercase): - return ''.join(random.choice(characters) for x in range(length)) + return ''.join(random.choices(characters, k=length)) def addfile_argparse(args): book = Epub(args.epub)