I'm trying to use pycharm. I can write code and run it. However, I do not know how to to debug the code. When I click the debug button, I get something similar to the below image:
Is there any special configuration needed for debugging in pycharm? Here is my configuration:
Starting Python Debugger To start debugging within the program just insert import pdb, pdb. set_trace() commands. Run your script normally, and execution will stop where we have introduced a breakpoint. So basically we are hard coding a breakpoint on a line below where we call set_trace().
The debugger is attached behind the scenes, so you don't have to configure anything specific to start a debugger session. If you are able to run your program from PyCharm, you will also be able to debug it using the same configuration.
I'd like to illustrate how to set parameters, as it took me a while to do this right:
Find the drop-down menu next to the "Run" button:
Choose the file you want to configure, then click "Edit Configurations":
Add script parameters:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With