Stop Thrashing About, Start Focused Debug Instead

 Still tossing and Turning ?
This will be a boring post because it's about me working through a debugging session after having emotionally 'thrashed about' instead of rationally dealing with the problem I think I'm facing.

Embarassingly, I suffer from a tendency to seek quick fixes to my coding issues by means of trial and error guess work in place of 
inserting proper debugging code and seriously analyzing the situation.

So below is a test run output where my initial understanding is that I forgot to unpack the lists output by one of my functions and I forgot to therafter join the nested text elements embedded inside one of my lists.

Is this first blush assessment of the situation correct? Answer appears below the image... 

No. That's not what's going on in the code that produced the above output.

I'd forgotten where I last left off. 
It was late at night. I was tired. I didn't leave behind progress notes for myself.

I had changed the plan so that I can insert substitute text strings in place of the ones initially specified. For example, at index location [3] I will be able to replace the 6 n's ("nnnnnn") with some specific line identifying text such as "(01): "

TO BE CONTINUED ...

POST SCRIPT =EXPLAINING / ARTICULATING THE PROBLEM TO THE DUCK

I updated my comments in the code to include the following:
# Date 11/28/2026   funcs_06 module ::: Main Project == Xpander-1 restart
#                   Sub-project A == Menu Box Template and Instantiator --> Shorthand codes for filling the box
#                       ^^^ func (1) = Built_List_o_Triples(Quad_subSpecs) func = inputs lists of FOUR args each
#                           ^^^ Quad = [char, xN, YoU, bold] = args to combine and pass to RICH
#                           ^^^ LoTrips = [ (char * xN), YoU, bold] = partially combined args for RICH
#                       ^^^ func (2) = pprint_collected_strs(List_o_Triples) = joins the strings & prints them

By writing the problem out this way, it became clear to me how to "join" my fields of strings and thereby get back to where I was before with having a printout of the assembled template:


 This gave me a temporary feeling of having mastered Python

(Of course Python answers to no master. So merely a fleeting hallucination)


MORE TO EXPLORE

QAB ::: Best practices of leaving progress notes when programming in Python
    ^^^-- (Real) The Importance of Writing Good Code Comments

::: How to determine the types of a collection of variables returned by a Python function

QAB ::: How to join the strings in your Python list

Comments

Popular posts from this blog

Links for Python Noobs

The Learn HOW to Learn Page

My 1st and 2nd OOP class definitions (aka What is an OOP class definition?)