Print values in Python debugger
<p>In my Python code, I have this call inside a bounded method:</p>

<pre><code>instances = instance_objects.InstanceList().get_by_host(ctxt, self.host)
</code></pre>

<p>When I debug with the Python debugger (pdb) and I issue <code>p instances</code> i get this output:</p>

<pre><code>InstanceList(objects=[Instance(bdfbf658-da32-445d-9560-56d496abcb9d)])
</code></pre>

<p>When I issue <code>p instances.objects</code> i get this output:</p>

<pre><code>[Instance(
access_ip_v4=None,
access_ip_v6=None,
architecture=None,
auto_disk_config=False,
availability_zone=None,
cell_name=None,
cleaned=False,
vcpus=1,
)]
</code></pre>

<p>How can I print out the value of vcpus in pdb?</p>

<p>Try</p>

<pre><code>p instances.objects[0].vcpus
</code></pre>

python python-2.7 pdb