Bo Peng wrote:

> This method works fine with only one minor problem. It would stop
> (waiting for user input) at help(str) command. I will have to find a way
> to feed the program with'q' etc.

replacing sys.stdin with something that isn't a TTY will fix this.

here's one way to do it:

    class wrapper:
        def __init__(self, file):
            self.file = file
        def isatty(self):
            return 0
        def __getattr__(self, key):
            return getattr(self.file, key)

    sys.stdin = wrapper(sys.stdin)

</F> 



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to