问题描述
所以我有一个ipython笔记本,它有很多大变量,有一点我想摆脱我所做的所有事情。我正在使用%reset_selective变量名来清除每一个,但是有60个这些变量,当我运行具有全部60个提示的块时,它会要求我为每个清除输入y / n。
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.
删除后,变量无法恢复。继续(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?
推荐答案
从:
如果正则表达式是不包括
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.
这篇关于iPython-有没有办法回答“y” (或忽略)所有y / n提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!