Ejemplo n.º 1
0
def readFile():
    filePath = app.getEntry("file")
    reader = FileReader.MyClass(filePath)
    method, eqn, interval, tolerance, maxIteration, validMethod = reader.getResult(
    )
    if not validMethod:
        app.errorBox("Invalid Method", "The file contains an invalid method")
    else:
        print(interval)
        if method == 1:
            app.setOptionBox("Method", 1)
        if method == 2:
            app.setOptionBox("Method", 2)
        if method == 3:
            app.setOptionBox("Method", 4)
        if method == 4:
            app.setOptionBox("Method", 5)
        if method == 5:
            app.setOptionBox("Method", 6)
        if method == 6:
            app.setOptionBox("Method", 8)
        if method == 7:
            app.setOptionBox("Method", 10)
        app.setEntry("f(x)=", eqn)
        app.setEntry("Max Iterations", maxIteration)
        app.setEntry("Epsilon", tolerance)
        if len(interval) == 1:
            app.setEntry("First Initial Guess", interval[0])
        elif len(interval) == 2:
            app.setEntry("First Initial Guess", interval[0])
            app.setEntry("Second Initial Guess", interval[1])
    print("read File")