1 import xkcdpass
.xkcd_password
as xp
5 #mywords = generate_wordlist(wordfile='3esl.txt', min_length=5, max_length=8,)
7 ## create a password with the acrostic 'face'
8 #print(generate_xkcdpassword(mywords, acrostic="face"))
10 def random_capitalisation(s
, chance
):
12 for i
, c
in enumerate(s
):
13 new_str
.append(c
.upper() if random
.random() < chance
else c
)
14 return "".join(new_str
)
17 words
= xp
.locate_wordfile()
18 mywords
= xp
.generate_wordlist(wordfile
=words
, min_length
=5, max_length
=8)
19 raw_password
= xp
.generate_xkcdpassword(mywords
)
22 print random_capitalisation(raw_password
, i
/10.0)