Created
August 22, 2015 20:55
-
-
Save paulohrpinheiro/2a434f281e552cf0dd35 to your computer and use it in GitHub Desktop.
Gera um texto aleatório.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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