Ir al contenido principal


Mostrando entradas de diciembre, 2020

I have been playing with pdb for debugging code (introductory level)

Well, this is time to talk about something I have been playing, the pdb standard module python provides. I'll talk in the context of py 3.7+ since there are differences that improve how to work with this. Well, first of all, as you should found in this field and coding experiences and challenges. You have to deal with bugs, unexpected errors, or even worst, unexpected behavior which sometimes is most difficult to trace. Here are some lights on how to use it, this is really useful if your life is coding :). Consider the following commands table. Command Description s Execute the current line and stop at the first possible occasion. n Continue the execution until the next line in the current function is reached or it returns. p Shows the values of variables in context code. ll List the whole source code for the current function or frame l In contrast to ll, this command shows a shorter snippet of code. l. If you pass the param . to this command, it will show you always 11 li