Sunday, October 16, 2016

A redneck's python debugger

python debug.py

OK, debug throws up a window, has a file dialog, fills the text box with a short python script.  What next? Count lines, use exec on them one by one.

User sets a break point, stop at the line number and call the break point routine.  Watch variables are simple, convert user text into :

exec(s"x =" userstring)
watch.insert(string(x)).

User has a list of strings identifying watched variable.   Two text windows and some buttons and a file dialog.  Extremely light weight, very few lines of code, only good for testing short snippets.  A hacker dream.

No comments: