Is there any short way to achieve what the APT (Advanced Package Tool) command line interface does in Python?

I mean, when the package manager prompts a yes/no question followed by [Yes/no], the script accepts YES/Y/yes/y or Enter (defaults to Yes as hinted by the capital letter).

The only thing I find in the official docs is input and raw_input

I know it’s not that hard to emulate, but it’s annoying to rewrite 😐

22 Answers
22

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *