def fileprocess(filename):

    filepath = "upload/" + filename
    tst = open(filepath)
    tstnum = []
    resnum = []
    i = 0

    try:

        for line in tst:
            num = int(line)
            tstnum.append(num)

        for i in range(len(tstnum)):
            resnum.append(coinapp.coin(tstnum[i]))

        #calls retres to combine lists
        finallist = retres(tstnum, resnum)
        
        return finallist

    #return empty list if test fails
    except:
        emtlist = []
        return emtlist
Exemple #2
0
def runcoin():
    try:
        a = coinapp.coin(request.form['numb'])
        return render_template("hello.html", a=a)
    except:
        return render_template("hello.html", a=0)
Exemple #3
0
def runcoin():
    try:
        a = coinapp.coin(request.form['numb'])
        return render_template("hello.html", a=a)
    except:
        return render_template("hello.html", a=0)