有没有办法回答“ y”? (或忽略)所有y / n提示? [英] Is there a way to answer "y" to (or ignore) all y/n prompts?

查看:131
本文介绍了有没有办法回答“ y”? (或忽略)所有y / n提示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台Jupyter笔记本,其中有很多大变量,有一点我想摆脱所有处理过的笔记本。我正在使用%reset_selective变量名清除每个变量,但是有60个这些变量,当我运行包含所有60条提示的块时,它要求我为每个清除输入y / n。

I have a Jupyter 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.

一旦删除,就不能恢复变量。是否继续(y / [n])?

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

有没有一种方法可以回答 y?一次还是全部跳过提示?

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

推荐答案

此处


%reset_selective [-f]正则表达式

%reset_selective [-f] regex

如果不使用正则表达式则不采取任何措施包括

No action is taken if regex is not included

选项
-f :不要求确认即强制重置。

Options -f : force reset without asking for confirmation.

似乎您可以将 -f 标志传递给%reset_selective 不用问就可以强制执行。

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

这篇关于有没有办法回答“ y”? (或忽略)所有y / n提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆