<p>How to debug the code written in python in container using azure dev spaces for kubernetes ?</p>

sushant kumar
<p>Debugging should be similar just like we have it in Dot net core. In dot net , we used to debug something like this</p>
<p><strong>Setting and using breakpoints for debugging</strong></p>
<p>If Visual Studio 2017 is still connected to your dev space, click the stop button. Open <code>Controllers/HomeController.cs</code> and click somewhere on line 20 to put your cursor there. To set a breakpoint hit F9 or click Debug then Toggle Breakpoint. To start your service in debugging mode in your dev space, hit F5 or click Debug then Start Debugging.</p>
<p>Open your service in a browser and notice no message is displayed. Return to Visual Studio 2017 and observe line 20 is highlighted. The breakpoint you set has paused the service at line 20. To resume the service, hit F5 or click Debug then Continue. Return to your browser and notice the message is now displayed.</p>
<p>While running your service in Kubernetes with a debugger attached, you have full access to debug information such as the call stack, local variables, and exception information.</p>
<p>Remove the breakpoint by putting your cursor on line 20 in <code>Controllers/HomeController.cs</code> and hitting F9.</p>
<p>Try something like this and see if it works.</p>
<p>Here is an article which explains debugging python code in visual studio 2017</p>
<p><a href="https://learn.microsoft.com/en-us/visualstudio/python/tutorial-working-with-python-in-visual-studio-step-04-debugging?view=vs-2017" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/visualstudio/python/tutorial-working-with-python-in-visual-studio-step-04-debugging?view=vs-2017</a></p>
