diff options
author | jomo <github@jomo.tv> | 2015-01-02 01:23:17 +0100 |
---|---|---|
committer | jomo <github@jomo.tv> | 2015-01-02 01:23:17 +0100 |
commit | 0842d921871a9bd33011d35fdd554189766bcf7c (patch) | |
tree | 98555886fd8ea9095c8bc9be065d89e035bbbcd3 /calc.py | |
parent | a51e715bc742ed9b717d3b666748d7ba4eb4699f (diff) |
docs
Diffstat (limited to 'calc.py')
-rw-r--r-- | calc.py | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -5,7 +5,12 @@ math_operators = ["+", "-", "*", "/", "&", "|"] ignore_operators = ["**", "&&", "||"] # ** may be too intensive, the others cause syntax errors calc_perm = "utils.calc" + def calc(text): + """ + extracts a mathematical expression from `text` + returns (expression, result) or None + """ expression = "" should_calc = False for char in text: |