import random import string letters = string.punctuation + string.ascii_letters print ( ''.join(random.choice(letters) for i in range(10000)) )