{ } Raw JSON

bundles / IPython 9.13.0 / IPython / core / magics / namespace / NamespaceMagics / pfile

function

IPython.core.magics.namespace:NamespaceMagics.pfile

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

Signature

def   pfile ( self parameter_s = '' namespaces = None )

Summary

Print (or run through pager) the file where an object is defined.

Extended Summary

The file opens at the line where the object definition begins. IPython will honor the environment variable PAGER if set, and otherwise will do its best to print the file in a convenient form.

If the given argument is not an object currently defined, IPython will try to interpret it as a filename (automatically adding a .py extension if needed). You can thus use %pfile as a syntax highlighting code viewer.

Aliases

  • IPython.core.magics.NamespaceMagics.pfile