Problem
- I want to understand source code of Kur (deep learning library)
- I have no proper training in programming, I prefer to learn by experimenting without prior theoretical knowledge
- I want an easy tool to help me dig into the detail workings of source code
- debug tools are like
pdb
library seem to be a good choice to try - But what is the easiest way to get started in experimenting source with
pdb
? - I just want to write one line of code to dig into details, rather than writing a few lines as demonstrated in many examples when you google
pdb
In other words, which function of pdb
should I use? and How to use it effectively for experimenting source?
Toy Example
- I want to explore the inner workings of
kur dump mnist.yml
- To make it simple, I want to just explore not beyond
__main__.py
andkurfile.py
. - To be more specific, I want to explore
dump()
andparse_kurfile()
in__main__.py
, andKurfile.__init__()
inkurfile.py
Their relationship is as follows:
console:
kur dump mnist.yml
-->
python:__main__.py
:main()
-->dump()
-->parse_kurfile()
-->
python:kurfile.py
:Kurfile
class -->__init__()
...
python: ... the rest is not to be exploredWhich function of
pdb
should I use to explore the execution flow fromdump()
toparse_kurfile()
and toKurfile.__init__()
and back todump()
again?
Update
How to effectively explore Jupyter notebook using pdb
?
pdb
inside Jupyter can't even remember console history, not good