How do I display thread/process Id in Python PDB?
<p>In Python, is there a way to display thread/process ID while debugging using PDB?</p>

<p>I was looking at <a href="https://docs.python.org/2/library/pdb.html" rel="nofollow">https://docs.python.org/2/library/pdb.html</a> but could not find anything related to it?</p>

<pre><code>(pdb) import os,threading; os.getpid(), threading.current_thread().ident
</code></pre>

<p>If you need to do this often, it would be convenient to add an alias in your <code>.pdbrc</code> file:</p>

<pre><code>alias tid import os,threading;; p os.getpid(), threading.current_thread().ident
</code></pre>

python pdb