Linked Questions
141 questions linked to/from How to step through Python code to help debug issues?
0
votes
3
answers
1k
views
How do I see how my program is executed line by line [duplicate]
I am trying to learn the basics of programming using python, and I am getting to the point where I have to deal with if statements and for loops. The thing is that I am getting a bit confused as to ...
0
votes
1
answer
1k
views
Is there a way to see the order in which lines are executed in PyCharm? [duplicate]
I am looking at a body of code and am trying to learn how to tell the order that each line executes. Is there a way to get this from a command in Python? Or is there a way to find out the order that ...
2
votes
1
answer
748
views
python + how to debug python script on linux as bash with -x [duplicate]
we are running some python scripts on linux
since python are sometimes difficult to understand in case of failure
then need to find a good way of debugging
for example from bash world its bash -x
...
0
votes
0
answers
563
views
How to see step by step execution of python script in terminal [duplicate]
I have python script
fruits.py
when I run it python fruits.py, it generates output.
Is there a way like some debug flag in python? or some code to write in script, with which I can see code ...
4
votes
1
answer
254
views
execute a python package from the shell step by step e.g. debugging mode [duplicate]
I want to observe the data flow in a package that is executed in the shell. Is the freqtrade bot. I want to run it step by step so I can observe the dataflow. This have to be executed in the shell ...
1
vote
1
answer
181
views
Advice for tool or a script to report a step by step Python file execution [duplicate]
Let's consider the small script above.
def d(n):
if n==0:
return 0
else:
return d(n−1)
print d(3)
Is there tool that can report each step action as a debugger can do ?
user avatar
user1054158
0
votes
2
answers
85
views
can we access a python console in a terminal via an interruption within the python script for debugging [duplicate]
To clarify my question, for example in some IDEs such as PyCharm one can put a breakpoint in the code, run the python script and when the code reaches that breakpoint, the program stops while the user ...
1
vote
1
answer
67
views
python While loop not terminating properly [duplicate]
I am writing a code for a simple game of tic-tac-toe using lists. I have used multiple functions to display the game board, to check for a winner and to get position input for X and O. The main while ...
0
votes
0
answers
45
views
How to stop a statement in Python? [duplicate]
I am newly converting to Python and want to know how to stop or pause in a script for diagnostic purposes. For instance, I want to do something like:
If Condition_is_True:
Statement
else:
...
260
votes
9
answers
403k
views
Show current assembly instruction in GDB
I'm doing some assembly-level debugging in GDB. Is there a way to get GDB to show me the current assembly instruction in the same way that it shows the current source line? The default output after ...
162
votes
15
answers
159k
views
Simpler way to put PDB breakpoints in Python code?
Just a convenience question. I've been a bit spoiled with debuggers in IDEs like Visual Studio and XCode. I find it a bit clumsy to have to type import pdb; pdb.set_trace() to set a breakpoint (I'd ...
148
votes
6
answers
190k
views
Using print statements only to debug
I have been coding a lot in Python of late. And I have been working with data that I haven't worked with before, using formulae never seen before and dealing with huge files. All this made me write a ...
185
votes
2
answers
33k
views
What is a debugger and how can it help me diagnose problems?
This is intended to be a general-purpose question to assist new programmers who have a problem with a program, but who do not know how to use a debugger to diagnose the cause of the problem.
This ...
55
votes
8
answers
22k
views
How can I make ipdb show more lines of context while debugging?
By default, during debugging in IPython, ipdb shows one line above and one line below the current position in code.
Is there an easy way to make the area shown a bit bigger? I'd think it would be ...
38
votes
6
answers
41k
views
How to debug a Python module run with python -m from the command line?
I know that a Python script can be debugged from the command line with
python -m pdb my_script.py
if my_script.py is a script intended to be run with python my_script.py.
However, a python module ...