Skip to content

Instantly share code, notes, and snippets.

@paulohrpinheiro
Created August 22, 2015 20:55
Show Gist options
  • Save paulohrpinheiro/2a434f281e552cf0dd35 to your computer and use it in GitHub Desktop.
Save paulohrpinheiro/2a434f281e552cf0dd35 to your computer and use it in GitHub Desktop.
Gera um texto aleatório.
import sys
import random
import string
LINES, WORDS, CHARS = [int(sys.argv[x]) for x in (range(1,1+3))]
randomize = random.Random()
random_number = randomize.randint
choice_one = randomize.choice
possible_letters = string.ascii_letters
for l in range(0, LINES):
for w in range(1, random_number(1, WORDS)):
for c in range(1, random_number(2, CHARS)):
print(''.join([_char for _char in choice_one(possible_letters)]), end='')
print(end=' ')
print()
s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment