How to Debug a Python app in Docker using NerdVision
David Thacker
April 24, 2021
Getting started with NerdVision
So you have seen NerdVision but maybe you are new to coding or don't have an app available that you can test NerdVision out with.
In this article we will give you a complete environment, running a basic Python calculator so you can start Debugging in under 5 minutes with NerdVision; this will work for any environment on Windows, Mac and Linux.
Well done, your application is now running on Docker. Now we need to go back to NerdVision so you can see how NerdVision works! : https://app.nerd.vision/
Now we need to add the source code so NerdVision can see what lines it needs to add the trace points on. In Gitlab; click clone, and choose : “Clone with HTTPS” the URL you will get is : https://gitlab.com/nerd-vision/nerdulator/python.git copy this and add it to your clipboard we will need to pase it in a moment.
Click on the bug icon to enter the NerdVision Debugger.
We now need to add the Nerdulator repository, go to the top right of the NerdVision app and click the plus button.
Changing the numbers allows you to get different outputs in the calculator.
To set a tracepoint please go back to NerdVision debugger: https://app.nerd.vision/ and the set a tracepoint.
To get you started I suggest you put a trace point on lines. 20, 34, 48 and 62 this is the line self.write({ you will be able to see the variables that appear in the application at that time depending on the function you using; add, divide, multiply, subtract
David Thacker is the Business Unit Owner for NerdVision and is focused on how NerdVision can make a developers' life better! Feel free to get in contact with me via twitter @dwthacker