def createSquareRows(nRows,strPreface,strHHMI,isShow): #by D@CC #on 2023DApr05 #Project: WioClock #Purpose: To print a row of large characters on the Wio Display if nRows<1 : print("Error S07 createSquareRows, nRows is <1:",nRows) #if end #print("into createSquareRows") #Purpose: to create 5 rows of square DIGITs #Returns: nothing, but prints 5 lines # each row contains strPreface, row of sqChar for each of HH:MI #strDisplay=strPreface #list to contain rows to display #strDigit="0" # digit to display #strDigit=strHHMI[0:1] # get 1st char to display #show("strDigit",strDigit,True) #show("@359, strHHMI:",strHHMI,True) listDisplay=[] #listDisplay.append("2") #listDisplay.append("3") #print("@352") #showList("listDisplay",True,listDisplay,True) showList("listDisplay",True,listDisplay,True) #print("@365") for i in range(nRows): #for each of the 5 rows strRow=strPreface for iC in range(len(strHHMI)): c=strHHMI[iC:iC+1] # for each character to show #show("c",c,isShow) #strDigit="0" # digit to display listForSqChar=listForSquareDigit(c) #2dim list of this sq char #showList("listForSqChar",True,listForSqChar,isShow) strSqCharRow=listForSqChar[i] #str of row i of this sq char #showList("listSqCharRow",True,strSqCharRow,isShow) #print("@376") #strSqCharRow =str(strSqCharRow) #show("strSqCharRow",strSqCharRow,isShow) strRow=strRow+strSqCharRow+" " # make it into a str #for end #show("strRow",strRow,True) # full row #print("@382") #show("strRow",strRow,isShow) #print(strRow) listDisplay.append(strRow) #for end showList("listDisplay",False,listDisplay,True) #strDisplay=strDisplay+str(listSquareDigit[0])+" " #create row return #def end #listOfObjecInList.def def show(objName,obj,isShow): if not isShow: return if not isinstance(objName,str): print("Error S01 in show Name is not a str:",objname) #if end if isinstance(obj, str) or isinstance(obj,list) or isinstance(obj,int)or isinstance(obj,bool): #is ok print(objName,":",obj,":") else: typeObj=type(obj) print("Error S02 in show obj is not a str, list, int nor bool:",objName,"type:",typeObj,"value:",obj) return #if end #def end ############################################################### #/createSquareRows.py