Exemple #1
0
def generate_token():
    global token
    auth = ''.join(
        random.choice(string.ascii_uppercase + string.digits +
                      string.ascii_lowercase) for _ in range(15))
    token = Token(auth)

    with open('token.json', 'w') as f:
        f.flush()
        f.write(token.toJSON())