Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/321.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iPython是否从函数调用中清除缓存?_Python_Caching_Ipython - Fatal编程技术网

iPython是否从函数调用中清除缓存?

iPython是否从函数调用中清除缓存?,python,caching,ipython,Python,Caching,Ipython,我的iPython内存有问题,我发现调用%clear out偶尔会清除这个问题。它似乎在我调用的一些函数中的某个地方缓存输出 我想把这一点纳入我的职能清除调用: self.outputcache.flush() 如何获取对iPython shell的引用(self)?换句话说:我如何在iPython中刷新outputcache,而不使用清除?输出缓存在您的用户名称空间中是Out或\oh,因此您可以调用Out.clear()编辑:这可能是与self.outputcache不同的输出缓存。我对0.

我的iPython内存有问题,我发现调用
%clear out
偶尔会清除这个问题。它似乎在我调用的一些函数中的某个地方缓存输出

我想把这一点纳入我的职能<代码>清除调用:

self.outputcache.flush()

如何获取对iPython shell的引用(
self
)?换句话说:我如何在iPython中刷新outputcache,而不使用
清除

输出缓存在您的用户名称空间中是
Out
\oh
,因此您可以调用
Out.clear()
编辑:这可能是与
self.outputcache
不同的输出缓存。我对0.10不太熟悉

如果需要对IPython外壳的引用,请在IPython 0.10中使用
\uuuuIP
\uuuuuuuuIython
。在0.11(开发版本)中,使用
get\u ipython()