Thomas, I don't know a cleaner way to break out of nested while loops, but based on the snippet you used as an example, you might want to check out the 'command' module if you haven't already. It provides a command-line interface. Alex.