title: Python asynchronous/threads debugging in Visual Studio Code
body: <p>I'm using Visual Studio Code for writing my python application. Inspecting variables and things like setting a watch in the left debugging pane works OK if I write a simple synchronous one-file program.</p>
  
  <p>However, I have code with classes in multiple files, and use various callbacks from other modules. Some which start a new thread.</p>
  
  <p>One of those modules is canopen
  I can step thru my code, but when I enter the second line (below)</p>
  
  <pre><code>can0 = canopen.Network()
  can0.connect(channel='can0', bustype='socketcan')
  </code></pre>
  
  <p>then the call stack changes from:</p>
  
  <pre><code>CALL STACK paused on breakpoint
  main
  &lt;module&gt;
  </code></pre>
  
  <p>to </p>
  
  <pre><code>CALL STACK paused on breakpoint
  MainThread
  Thread#15034.........
  </code></pre>
  
  <p>and simultaneously</p>
  
  <ul>
  <li>the variables pane clears</li>
  <li><p>and the watches in my watch window shows:</p>
  
  <p><code>can0: not available</code></p></li>
  </ul>
  
  <p>How can I (setup VS studio code with Python to) inspect/debug my python code with various threads and code in various files?</p>
  
  <p>Regards,
  Bas</p>