· 6 years ago · Jul 11, 2019, 02:38 PM
1#!/usr/bin/env python
2import random
3
4# Set allowed characters
5ALLOWED_CHARACTERS = "abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)"
6
7# Generate secret key
8secret_key = "".join([random.choice(ALLOWED_CHARACTERS) for i in range(50)])
9
10# Print secret key
11print(secret_key)