diff --git a/modules/calc.py b/modules/calc.py index dbda9a3..9a5b187 100755 --- a/modules/calc.py +++ b/modules/calc.py @@ -91,6 +91,15 @@ def c(phenny, input): c.commands = ['c'] c.example = '.c 5 + 3' +def py(phenny, input): + query = input.group(2).encode('utf-8') + uri = 'http://tumbolia.appspot.com/py/' + answer = web.get(uri + web.urllib.quote(query)) + if answer: + phenny.say(answer) + else: phenny.reply('Sorry, no result.') +py.commands = ['py'] + def wa(phenny, input): if not input.group(2): return phenny.reply("No search term.")