You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
668 B
Python
30 lines
668 B
Python
6 years ago
|
#!/usr/bin/env python3
|
||
|
|
||
|
import json, random, textwrap
|
||
|
|
||
|
with open('terms.json', 'r') as f:
|
||
|
terms = json.load(f)
|
||
|
|
||
|
def make_pub():
|
||
|
actor = random.choice(terms['actor'])
|
||
|
action = random.choice(terms['action'])
|
||
|
prefix = ''
|
||
|
sort = random.choice(terms['sort'])
|
||
|
media = random.choice(terms['media'])
|
||
|
|
||
|
if random.randint(0,2) == 0:
|
||
|
prefix = random.choice(terms['prefix']) + '-'
|
||
|
|
||
|
return actor + ' ' + action + ' ' + prefix + sort + ' ' + media
|
||
|
|
||
|
def make_call():
|
||
|
text = 'Calling all '
|
||
|
for _ in range(20):
|
||
|
text += make_pub() + ', '
|
||
|
text = text[:-2]
|
||
|
text += '.'
|
||
|
|
||
|
return text
|
||
|
|
||
|
print(textwrap.fill(make_call()))
|