python command line yes/no input

Posted by h3 on Stack Overflow See other posts from Stack Overflow or by h3
Published on 2010-06-15T01:13:54Z Indexed on 2010/06/15 1:22 UTC
Read the original article Hit count: 249

Filed under:

Is there any short way to achieve what APT does in Python ?

I mean, when the package manager prompts a yes/no question followed by "[Yes/no]".

The scripts accepts YES/Y/yes/y or "enter" (defaults to Yes as hinted by the capital)

The only thing I find in the official doc is input/raw_input..

I know it's not that hard to emulate, but it's annoying to rewrite :|

© Stack Overflow or respective owner

Related posts about python