def random_alphabetical_string(self, maxlen = 1024, exact = False):
"""
Filenames are usually rejected if they contain
funky characters, blocking execution
"""
if exact:
string_len = maxlen
else:
string_len = random.randint(1, maxlen)
alphabet = string.ascii_letters + string.digits
s = ''.join(random.choice(alphabet) for _ in range(string_len))
return s
评论列表
文章目录