Here is the situation: I have a python program that crashes when i do something that shouldn't crash. I'd like to debug it myself so i am not asking for help on why it crashes but how i debug it like i want to.
I want to compare what lines execute in what order when it works and when i do the thing that doesn't work.
I found the trace module which you can use like this:
python -m trace -t program.py
And it will "Display lines as they are executed" (print them). However, the program i am making is an open world game in curses and therefore the output gets really weird since the terminal is already used by my curses game and i basically cannot use it.
So i have to write the output to a file somehow if i want to use it.
How do i make it write to a file, or are there any other methods?