如何在ipython中清除变量? [英] How to clear variables in ipython?
本文介绍了如何在ipython中清除变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有时我会在同一个ipython会话中重新运行一个脚本,当变量尚未清除时,我会收到很多惊喜。如何清除所有变量?
每次调用魔术命令%run时,是否有可能以某种方式强制执行此操作?
Sometimes I rerun a script within the same ipython session and I get bad surprises when variables haven't been cleared. How do I clear all variables? And is it possible to force this somehow every time I invoke the magic command %run?
谢谢
推荐答案
%reset
似乎清除已定义的变量。
%reset
seems to clear defined variables.
这篇关于如何在ipython中清除变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文