Last active
September 9, 2016 06:15
-
-
Save caioluders/aceb315e6c9fabe1407f4254a2c849f0 to your computer and use it in GitHub Desktop.
This file contains 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
from __future__ import print_function | |
import os , random , json | |
w = set() | |
stop_file = json.load(open("pt.json")) # 1 | |
for f in os.listdir('p03ms') : | |
fo = open("p03ms/"+f).read() | |
fo = fo.split(" ") | |
for s in fo : | |
w.add(s) # 2 | |
w0rds = list(w) | |
p03m = [] | |
for i in range(0,random.randint(0,10)) : | |
p03m.append([]) | |
for y in range(0,random.randint(0,20)) : # 3 | |
k = random.randint(0,10) | |
if k > 7 : # 4 | |
p03m[i].append(w0rds[random.randint(0,len(w0rds)-1)]) | |
else : | |
p03m[i].append(stop_file[random.randint(0,len(stop_file)-1)]) | |
p03m[i].append(" ") | |
for l in p03m : | |
for c in l : | |
print(c,end="") # 5 | |
print() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment