You are viewing an older version (9.10.0). Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython 9.10.0 / IPython / core / magics / namespace / NamespaceMagics / who

function

IPython.core.magics.namespace:NamespaceMagics.who

source: /IPython/core/magics/namespace.py :286

Signature

def   who ( self parameter_s = '' )

Summary

Print all interactive variables, with some minimal formatting.

Extended Summary

If any arguments are given, only variables whose type matches one of these are printed. For example

%who function str

will only list functions and strings, excluding all other types of variables. To find the proper type names, simply use type(var) at a command line to see how python prints type names. For example:

In [1]: type('hello')\
Out[1]: <type 'str'>

indicates that the type name for strings is 'str'.

%who always excludes executed names loaded through your configuration file and things which are internal to IPython.

This is deliberate, as typically you may load many modules and the purpose of %who is to show you only what you've manually defined.

Examples

Define two variables and list them with who:: In [1]: alpha = 123 In [2]: beta = 'test' In [3]: %who alpha beta In [4]: %who int alpha In [5]: %who str beta

Aliases

  • IPython.core.magics.NamespaceMagics.who