Completely disable IPython output caching

后端 未结 4 514
日久生厌
日久生厌 2021-02-02 00:42

I\'m dealing with some GB-sized numpy arrays in IPython. When I delete them, I definitely want them gone, in order to recover the memory. IPythons output cache is quite annoying

4条回答
  •  忘掉有多难
    2021-02-02 01:11

    Enter

    echo "__builtin__._ = True" > ~/.config/ipython/profile_default/startup/00-disable-history.py
    

    and your history should be gone.

    Edit:

    Seems like the path to the config directory is sometimes a bit different, either ~/.config/ipython or just ~/.ipython/. So just check which one you got and adjust the path accordingly. The solution still works with jupyter console.

提交回复
热议问题