docs
This commit is contained in:
5
calc.py
5
calc.py
@@ -5,7 +5,12 @@ math_operators = ["+", "-", "*", "/", "&", "|"]
|
|||||||
ignore_operators = ["**", "&&", "||"] # ** may be too intensive, the others cause syntax errors
|
ignore_operators = ["**", "&&", "||"] # ** may be too intensive, the others cause syntax errors
|
||||||
calc_perm = "utils.calc"
|
calc_perm = "utils.calc"
|
||||||
|
|
||||||
|
|
||||||
def calc(text):
|
def calc(text):
|
||||||
|
"""
|
||||||
|
extracts a mathematical expression from `text`
|
||||||
|
returns (expression, result) or None
|
||||||
|
"""
|
||||||
expression = ""
|
expression = ""
|
||||||
should_calc = False
|
should_calc = False
|
||||||
for char in text:
|
for char in text:
|
||||||
|
|||||||
Reference in New Issue
Block a user