コード例 #1
0
def showStack(stack, buf):
    clear()
    try:
        print(stack)
    except KeyboardInterrupt:
        clear()
        print('too large to display!')
        stack.rpnView(buf)
コード例 #2
0
def getch():
    rawChar = rawGetch()
    if rawChar == 'Q': # naive escape
        clear()
        print("bye.")
        exit()
    else:
        inpChar = rawChar
    return inpChar
コード例 #3
0
def showCalc(stack, buf, errors):
    '''
    If there are errors, display those.
    Then show the "screen" of the calculator.
    '''
    clear()
    nonErrors = { '', None, '\n' }
    if errors not in nonErrors:
        print(errors)
    stack.rpnView(buf) # correct view for HP calcs
コード例 #4
0
ファイル: help.py プロジェクト: qguv/rpcalc
def main():
    while True:
        clear()
        print(intro)
        sym = input("] ")
        if sym is 'Q':
            clear()
            print("bye.")
            exit()
        elif sym is 'q':
            break
        elif sym is '?':
            for key in ops.bindings.keys():
                print(key)
            null = input(pause)
        elif sym in ops.bindings.keys():
            getHelp(sym)
            null = input(pause)
        else:
            print("not available!")
            null = input(pause)
コード例 #5
0
ファイル: help.py プロジェクト: kmolab/rpcalc
def main():
    while True:
        clear()
        print(intro)
        sym = input("] ")
        if sym is 'Q':
            clear()
            print("bye.")
            exit()
        elif sym is 'q':
            break
        elif sym is '?':
            for key in ops.bindings.keys():
                print(key)
            null = input(pause)
        elif sym in ops.bindings.keys():
            getHelp(sym)
            null = input(pause)
        else:
            print("not available!")
            null = input(pause)