def prompt(jep):
    try:
        line = None
        while True:
            ran = True
            try:
                ran = jep.eval(line)
            except:
                traceback.print_exc()

            try:
                if (ran):
                    line = raw_input(PS1)
                else:
                    line = raw_input(PS2)
            except:
                break

    finally:
        if has_readline:
            readline.write_history_file(HISTFILE)
def prompt(jep):
    try:
        line = None
        while True:
            ran = True
            try:
                ran = jep.eval(line)
            except:
                traceback.print_exc()

            try:
                if(ran):
                    line = raw_input(PS1)
                else:
                    line = raw_input(PS2)
            except:
                break

    finally:
        if has_readline:
            readline.write_history_file(HISTFILE)
                if (ran):
                    line = raw_input(PS1)
                else:
                    line = raw_input(PS2)
            except:
                break

    finally:
        if has_readline:
            readline.write_history_file(HISTFILE)


if __name__ == '__main__':
    Jep = findClass('jep.Jep')
    jep = Jep(True)

    # Pass argv to interactive prompt. We can't pass a Python object,
    # but we can make a new one.
    jep.eval("argv = %s" % argv)

    # make sure we can import from the current directory
    jep.eval('import sys; sys.path.append("")')

    try:
        prompt(jep)
    except:
        traceback.print_exc()

    print ''
    jep.close()
                if(ran):
                    line = raw_input(PS1)
                else:
                    line = raw_input(PS2)
            except:
                break

    finally:
        if has_readline:
            readline.write_history_file(HISTFILE)


if __name__ == '__main__':
    Jep = findClass('jep.Jep')
    jep = Jep(True)

    # Pass argv to interactive prompt. We can't pass a Python object,
    # but we can make a new one.
    jep.eval("argv = %s" % argv)

    # make sure we can import from the current directory
    jep.eval('import sys; sys.path.append("")')

    try:
        prompt(jep)
    except:
        traceback.print_exc()

    print ''
    jep.close()