예제 #1
0
def AddUnknown(unknown):
    addedUndef = unknown
    if not addedUndef in letters:
        print ESI.WriteLog("You are adding a unknown not in the letters list")
    else:
        if addedUndef in ESI.ReadUndef():
            print ESI.WriteLog(
                "You are adding a unknown that exist in the unknown list")
        else:
            ESI.WriteUndef(addedUndef)
예제 #2
0
def ShowUnknown():
    undefList = ESI.ReadUndef()
    tmpIndexUndefShow = 1
    for undef in undefList:
        print str(tmpIndexUndefShow) + ")" + " " + str(undef)
        tmpIndexUndefShow += 1
예제 #3
0
                        ESC.UndefAutoCheck(addedFunc))
                    print "Do you want to add these unknowns?(y/n)"
                    confirm = raw_input()
                    if confirm == "y":
                        for unknown in ESC.UndefAutoCheck(addedFunc):
                            AddUnknown(unknown)
        continue

    #添加未知数
    elif cmd == "addUnkn":
        addedUndef = raw_input("Enter your unknown here:")
        if not addedUndef in letters:
            print ESI.WriteLog(
                "You are adding a unknown not in the letters list")
        else:
            if addedUndef in ESI.ReadUndef():
                print ESI.WriteLog(
                    "You are adding a unknown that exist in the unknown list")
            else:
                ESI.WriteUndef(addedUndef)

    #添加函数
    elif cmd == "addFunc":
        print "Enter your function here:"
        addedFunc = raw_input("f(x) = ")
        if ESC.CheckEquation_equa(addedFunc) != 0:
            ESI.WriteLog("Try to add function: " + addedFunc)
            ESI.WriteLog(ESW.Warn("excessiveEquater"))
        else:
            if ESFC.PurifyEquation(addedFunc) in ESI.ReadFunc():
                print ESI.WriteLog(