def repl_loop(): while True: raw = input("> ") if raw == 'exit': break parts = raw.split(" ") command = parts[0] del parts[0] if command in repl: repl[command](parts) repl_loop()