ChristineB ChristineB - 1 year ago 87
Python Question

iPython- Is there a way to answer "y" to (or ignore) all y/n prompts?

So I have an ipython notebook that has a lot of large variables, and at one point I want to get rid of all the ones I'm done with. I'm using %reset_selective variablename to clear each one, but there's 60 of these variables and when I run the block that has all 60 prompts, it asks me to enter y/n for every clear.

"Once deleted, variables cannot be recovered. Proceed (y/[n])?"

Is there a way I can answer "y" for all of them at once, or to skip the prompt altogether?

Answer Source

Reading from here:

%reset_selective [-f] regex

No action is taken if regex is not included

Options -f : force reset without asking for confirmation.

Seems you're able to pass -f flag to %reset_selective to have it force without asking.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download