Use random.choices instead of random.choice in a loop.
This commit is contained in:
parent
9780368741
commit
d36efec25f
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue