gpt4 book ai didi

python - 如何列出 ipython session 中加载的所有名称?

转载 作者:太空宇宙 更新时间:2023-11-04 05:42:58 25 4
gpt4 key购买 nike

我通过将一些 *.py 文件放入 ~/.ipython/profile_default/startup 来将变量和函数注入(inject)我的默认 ipython 命名空间。

我可以通过键入 %who%who_ls 列出在 ipython session 中新创建的名称。但是,我的启动文件中定义的名称没有显示出来。是否有神奇的功能或方法可以将启动目录中引入的所有名称列出到事件的 ipython 交互式 session 中?

最佳答案

您可以通过 %psearch 使用模式搜索.要列出不在内置空间中的所有对象,请使用:

%psearch -e builtin *

%psearch [options] PATTERN [OBJECT TYPE]

Note: ? can be used as a synonym for %psearch, at the beginning or at the end: both a*? and ?a* are equivalent to '%psearch a*'. Still, the rest of the command line must be unchanged (options come first), so for example the following forms are equivalent

%psearch -i a* function -i a* function? ?-i a* function

关于python - 如何列出 ipython session 中加载的所有名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33221793/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com