Exemplo n.º 1
0
def help(local="all"):
    print()
    print("Arithmetic:")
    print("a+b    : Add.")
    print("a-b    : Subtract.")
    print("a*b    : Multiply.")

    if local == "all" or local == "met":
        print("a:b    : Divide.")

    if local == "imp" or local == "py":
        print("a/b    : Divide.")

    if local == "py":
        print("a**n   : Power.")

    if local == "all" or local == "met" or local == "imp":
        print("a^n    : Power.")

    print("Va     : Square root.")
    print("nVa    : nth root.")
    print("LOGa   : Logarithm to base 10.")
    print("LOGn;a : Logarithm to base n.")
    print("LNa    : Natural logarithm..")
    print("a!     : Factorial.")
    print("ABSa   : Absolute value.")

    if local == "all" or local == "met":
        print("a,b    : Comma.")

    if local == "imp" or local == "py":
        print("a.b    : Dot.")

    print("()     : Brackets.")
    print("[]     : Squared brackets.")
    print()

    print("Goniometric functions:")
    print("SINa   : Sine.")
    print("COSa   : Cosine.")
    print("TANa   : Tangent.")
    print("COTa   : Cotangent.")
    print("SECa   : Secant.")
    print("CSCa   : Cosecant.")
    print("ASINa  : Arcsine.")
    print("ACOSa  : Arccosine.")
    print("ATANa  : Arctangent.")
    print("ACOTa  : Arccotangent.")
    print("ASECa  : Arcsecant.")
    print("ACSCa  : Arccosecant.")
    print("DEGa   : Convert radials to degrees.")
    print()

    print("Logic:")
    print("~a     : Negation of a.")
    print("a == b : a equal to b?")
    print("a != b : a different from b?")
    print("a < b  : a lighter than b?")
    print("a <= b : a lighter than or equal to b?")
    print("a > b  : a greater than b?")
    print("a >= b : a greater than or equal to b?")
    print()

    print("Constants:")
    print("pi     : Constant Pi.")
    print("tau    : Constant Tau (2pi).")
    print("phi    : The golden ratio.")
    print("inf    : Infinity.")
    print("e      : Euler's constant.")
    print()

    print("Miscellaneous:")
    print("a := * : Save * to variable a.")
    print(">DMS   : (on end) Convert to a°b'c\".")
    print(">RAD   : (on end) Convert to radians.")
    print(">INT   : (on end) Convert to an integer.")
    print(">DEC   : (on end) Do not round.")
    print(">DECn  : (on end) Round to n decimals.")
    print(">ACC   : (on end) Convert to a fraction (approximation).")
    print("_      : Most recent input.")
Exemplo n.º 2
0
    print("inf    : Infinity.")
    print("e      : Euler's constant.")
    print()

    print("Miscellaneous:")
    print("a := * : Save * to variable a.")
    print(">DMS   : (on end) Convert to a°b'c\".")
    print(">RAD   : (on end) Convert to radians.")
    print(">INT   : (on end) Convert to an integer.")
    print(">DEC   : (on end) Do not round.")
    print(">DECn  : (on end) Round to n decimals.")
    print(">ACC   : (on end) Convert to a fraction (approximation).")
    print("_      : Most recent input.")

title(i18n.t("MPL Interactive Prompt (c) 2015 Evert Provoost"))
print("MPL Interactive Prompt (c) 2015 Evert Provoost")
mplenv = mpl(opt={'dec': 5, 'acc': True, 'todms': False})

while True:
    cmd = input(">? ").lower()

    if cmd == "help" or cmd == "?":
        print(">! Help for MPL:")
        print("cls : Clear the screen.")
        help()

    elif cmd == "cls":
        cls()

    elif cmd == "exit":
        sys.exit()