def main():
    while True:
        func_str = input("please enter formula\n")
        #if func_str=="exit"or"e":
        #    break
        c = cal.calculator()
        print("The Answer is :", c.calculate(func_str))
示例#2
0
文件: app.py 项目: rssmj/Encon-ds
def cal(device, state, hours, days):
    print("Visited Calculator URL Page")
    print("------------------------------")
    device = device
    state = state
    hours = float(hours)
    days = int(days)
    y = calculator(device, state, hours, days)
    return jsonify(y)
示例#3
0
文件: app.py 项目: rssmj/Encon-ds
def cal_output():
    print("Visited Calculator Output Page")
    print("------------------------------")
    device = request.form["device"]
    state = request.form["state"]
    hours = float(request.form["hours"])
    days = int(request.form["days"])
    x = {"device": device, "state": state, "hours": hours, "days": days}
    y = calculator(device, state, hours, days)
    return {"inputs": x, "outputs": y}
def main():
    while True:
        func_str = input("please enter formula\n")
        c = cal.calculator()
        print("The Answer is :", c.calculate(func_str))
示例#5
0
def main():
    while True:
        func_str = input("please enter formula\n")
        c = cal.calculator()
        c.calculate(func_str)
示例#6
0
from cal import calculator

cal1 = calculator([1, 2, 3, 4, 5])
cal1.sum()