Skip to content

Instantly share code, notes, and snippets.

@caioluders
Last active September 9, 2016 06:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caioluders/aceb315e6c9fabe1407f4254a2c849f0 to your computer and use it in GitHub Desktop.
Save caioluders/aceb315e6c9fabe1407f4254a2c849f0 to your computer and use it in GitHub Desktop.
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