示例#1
0
def my_form_lite_get():
    if request.method =='POST':
        X=request.form['lat']
        Y=request.form['long']
    else:
        X = request.args.get['lat']
        Y = request.args.get['long']
    try:
        X=float(X)
        try:
            Y=float(Y)
            try:
                res=call_nn.populate(X,Y)

                try:
                    return render_template('lite.html',error='0',r=str(res))
                except Exception as e:
                    print("Erer",e)
                    return str(e)
            except Exception as e:
                print("Error while calling function")
                return render_template("lite.html",error='2',r='-1')
        except:
            print(Y)
            return render_template("lite.html",error='1',r='-1')
    except:
        print(X)
        return render_template("lite.html",error='1',r='-1')
示例#2
0
def my_form_live_error(X,Y):

    r=random.randint(0,5)
    names=[["Baidyanath Kundu","Anish Biswas","Aryaman Pande"],["Baidyanath Kundu","Aryaman Pande","Anish Biswas"],["Aryaman Pande","Baidyanath Kundu","Anish Biswas"],["Anish Biswas","Baidyanath Kundu","Aryaman Pande"],["Aryaman Pande","Anish Biswas","Baidyanath Kundu"],["Anish Biswas","Aryaman Pande","Baidyanath Kundu"]]
    
    print(Y)
    try:
        X=float(X)
        try:
            Y=float(Y)
            try:
                res=call_nn.populate(X,Y)
                try:
                    return render_template('live.html',error='0',name=names[r],r=str(res))
                except Exception as e:
                    print("Erer",e)
                    return str(e)
            except Exception as e:
                print("Error while calling function")
                return render_template("live.html",error='1',name=names[r],r='-1')
        except:
            print(Y)
            return render_template("live.html",error='1',name=names[r],r='-1')
    except:
        print(X)
        return render_template("live.html",error='1',name=names[r],r='-1')
示例#3
0
def my_form_live(X,Y):
    try:
        X=float(X)
        try:
            Y=float(Y)
            try:
                res=call_nn.populate(X,Y)
                if(res==-1):
                    print("Error")
                    return redirect(url_for('.live', lat=str(X),long=str(Y),error='2',result='-1'))
                try:
                    return redirect(url_for('.live', lat=str(X),long=str(Y),error='0',result=str(res)))
                except Exception as e:
                    print("Error",e)
                    return redirect(url_for('.live', lat=str(X),long=str(Y),error='2',result='-1'))
            except Exception as e:
                print("Error while calling function")
                return redirect(url_for('.live', lat=str(X),long=str(Y),error='2',result='-1'))
        except:
            print(Y)
            return redirect(url_for('.live', lat=str(X),long=str(Y),error='1',result='-1'))
    except:
        print(Y)
        return redirect(url_for('.live', lat=str(X),long=str(Y),error='1',result='-1'))