Пример #1
0
def interact_python():
    """Runs an interactive interpreter; halts the diesel app when finished."""
    globals_ = globals()
    env = {
        '__builtins__':globals_['__builtins__'],
        '__doc__':globals_['__doc__'],
        '__name__':globals_['__name__'],
        'diesel':diesel,
    }
    inp = create_line_input_stream(sys.stdin)

    def diesel_input(prompt):
        sys.stdout.write(prompt)
        sys.stdout.flush()
        return inp.get().rstrip('\n')

    code.interact(None, diesel_input, env)
    diesel.quickstop()
Пример #2
0
def interact_python():
    """Runs an interactive interpreter; halts the diesel app when finished."""
    globals_ = globals()
    env = {
        '__builtins__': globals_['__builtins__'],
        '__doc__': globals_['__doc__'],
        '__name__': globals_['__name__'],
        'diesel': diesel,
    }
    inp = create_line_input_stream(sys.stdin)

    def diesel_input(prompt):
        sys.stdout.write(prompt)
        sys.stdout.flush()
        return inp.get().rstrip('\n')

    code.interact(None, diesel_input, env)
    diesel.quickstop()
Пример #3
0
def consume():
    q = create_line_input_stream(sys.stdin)
    while True:
        v = q.get()
        print 'DIESEL GOT', v
Пример #4
0
def consume():
    q = create_line_input_stream(sys.stdin)
    while True:
        v = q.get()
        print 'DIESEL GOT', v