Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You are really mixing together two different things.</p> <p>Use <a href="https://docs.python.org/3/library/functions.html#dir" rel="noreferrer"><code>dir()</code></a>, <a href="https://docs.python.org/3/library/functions.html#vars" rel="noreferrer"><code>vars()</code></a> or the <a href="https://docs.python.org/3/library/inspect.html" rel="noreferrer"><code>inspect</code></a> module to get what you are interested in (I use <code>__builtins__</code> as an example; you can use any object instead).</p> <pre><code>&gt;&gt;&gt; l = dir(__builtins__) &gt;&gt;&gt; d = __builtins__.__dict__ </code></pre> <p>Print that dictionary however fancy you like:</p> <pre><code>&gt;&gt;&gt; print l ['ArithmeticError', 'AssertionError', 'AttributeError',... </code></pre> <p>or</p> <pre><code>&gt;&gt;&gt; from pprint import pprint &gt;&gt;&gt; pprint(l) ['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException', 'DeprecationWarning', ... &gt;&gt;&gt; pprint(d, indent=2) { 'ArithmeticError': &lt;type 'exceptions.ArithmeticError'&gt;, 'AssertionError': &lt;type 'exceptions.AssertionError'&gt;, 'AttributeError': &lt;type 'exceptions.AttributeError'&gt;, ... '_': [ 'ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException', 'DeprecationWarning', ... </code></pre> <p>Pretty printing is also available in the interactive debugger as a command:</p> <pre><code>(Pdb) pp vars() {'__builtins__': {'ArithmeticError': &lt;type 'exceptions.ArithmeticError'&gt;, 'AssertionError': &lt;type 'exceptions.AssertionError'&gt;, 'AttributeError': &lt;type 'exceptions.AttributeError'&gt;, 'BaseException': &lt;type 'exceptions.BaseException'&gt;, 'BufferError': &lt;type 'exceptions.BufferError'&gt;, ... 'zip': &lt;built-in function zip&gt;}, '__file__': 'pass.py', '__name__': '__main__'} </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload