From 2945df70669a8ff5bd6a16f92b002c357d1f9d3d Mon Sep 17 00:00:00 2001 From: ultrageranium Date: Sun, 22 Apr 2018 22:54:00 +0200 Subject: [PATCH] hello call.py --- call.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 call.py diff --git a/call.py b/call.py new file mode 100755 index 0000000..2cc0547 --- /dev/null +++ b/call.py @@ -0,0 +1,29 @@ +#!/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()))