简体   繁体   English

如何列出 ipython 会话中加载的所有名称?

[英]How to list all names loaded in in an ipython sessions?

I am injecting variables and functions into my default ipython namespace by dropping some *.py files into ~/.ipython/profile_default/startup .我通过将一些*.py文件放入~/.ipython/profile_default/startup将变量和函数注入我的默认 ipython 命名空间。

I can list names that are newly created in an ipython session by typing %who or %who_ls .我可以通过键入%who%who_ls列出在 ipython 会话中新创建的名称。 However the names defined in my startup files do not show up.但是,我的启动文件中定义的名称没有显示出来。 Is there a magic function or a way to list all names introduced in the startup directory into an active ipython interactive session ?是否有魔术功能或方法可以将启动目录中引入的所有名称列出到活动的 ipython 交互式会话中?

You can use pattern searching via %psearch .您可以通过%psearch使用模式搜索。 To list all objects NOT in the builtin space, use:要列出所有不在内置空间中的对象,请使用:

%psearch -e builtin *

%psearch [options] PATTERN [OBJECT TYPE] %psearch [选项] 模式 [对象类型]

Note: ?笔记: ? can be used as a synonym for %psearch, at the beginning or at the end: both a*?可以用作 %psearch 的同义词,在开头或结尾:既 a*? and ?a* are equivalent to '%psearch a*'.和 ?a* 等价于 '%psearch a*'。 Still, the rest of the command line must be unchanged (options come first), so for example the following forms are equivalent尽管如此,命令行的其余部分必须保持不变(选项在前),因此例如以下形式是等效的

%psearch -ia* function -ia* function? %psearch -ia* 函数 -ia* 函数? ?-ia* function ?-ia* 函数

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM