[Tutor] Debugging skills

Roel Schroeven roel at roelschroeven.net
Fri Jan 5 17:14:56 EST 2024


Mats Wichmann schreef op 5/01/2024 om 14:56:
> while we're nattering on a whole range of sort-of-debugging topics,
> here's something I've occasionally wondered about, when a beginner has
> written something that makes sense only to them, not to the Python
> interpreter.  Regexes are confusing, so there are several websites (see
> for example regex101.com) where you can enter your "code" (regex) and as
> it's interpreted, will show you an explanation in words in a separate
> pane.  Does anyone know if there's a similar thing for Python code?
> "This is what you wrote actually means to the interpreter".  Ones I know
> about (like at Programiz, w3schools, online-python) don't attempt the
> explanation part.  It's not something that's likely to be useful for
> very many cases, but I could see where in the beginning there might be
> some benefit...

Python Tutor goes a bit in that direction, though not nearly as far as 
those regex websites.

https://pythontutor.com/python-compiler.html

I think it's mostly useful to visualize how recursion works.

(As an aside, not that despite the name it can also work for Java, C, 
C++, and JavaScript.)

-- 
"This planet has - or rather had - a problem, which was this: most of the
people living on it were unhappy for pretty much of the time. Many solutions
were suggested for this problem, but most of these were largely concerned with
the movement of small green pieces of paper, which was odd because on the whole
it wasn't the small green pieces of paper that were unhappy."
         -- Douglas Adams


More information about the Tutor mailing list