Back in Business (Part II)


 There was the FEAR that somehow my latest functions would not work for a next display frame.

That fear was misplaced. The code does as it is told.

Not only did the functions work, they accepted f-strings as their string-typed inputs. This meant I could drop ANSI Box Drawing characters in as the filler characters with color !!! The result shown below as the second screen grab: (By the Way, left click on each grab to see it more clearly and in bigger form)


Upon hitting the "c" key (no return key needed), the following next learning frame comes up:


The second frame looks cool on first glance. However it's got problems. I'm still learning which ANSI Box Draw characters will work best and in what colors. Also, text alignment is still a problem. Note that the last line points out a logic error. For reasons currently not determined, I asked my indented-list-generating function to do lines ending with A-L. But it insisted on doing M as well. What am I talking about? For the answer we have to look at the message assignments in my messgs_01 module. Here are some of them:


As seen in the above third screen-grab, each string variable name has three parts: (1) the message_type (in this case it is defined by string portion "aside_"; (2) a frame ID string (in this case, "001" and (3) and ending alphabetic letter (e.g. "A" thru "L"). The list generating function is fed the three parts separately, each as a string. In other words, fn.gen_indented_list("mssg_type", "frame_ID", "A-L"). Strings 1 and 2 are concatenated together. The range string is split() about the dash and the ANSI codes for the low/start alpha and for the hi/ending alpha are determined. A WHILE loop steps from low to hi and prints each. 

MORE TO EXPLORE



Comments

Popular posts from this blog

Links for Python Noobs

Everything From Everywhere All At Once -- Doesn't Fly

I Lied