#Test_ix_grep.py def Test_ix_grep(): import sys sys.path.append("/home/pi/Desktop/IX_assets/ix") from ix_pkg import ix_grep from ix_pkg import ix_grep_v00 #by D@CC #On 2023LDec03 #Purpose: to test ix_grep #Article: 211 # #Uses: file Desktop/a/IXp/ix_eDict.txt" # ix_grep() # file="/home/pi/Desktop/a/IXp/ix_eDict.txt" print("Hit Cr to make list:") #enter null to create a list of records parm1=input("?") if parm1=="": #isMakeList=True #ix_grep will make a list is parm1="" #if isMakeList : # parm1="" #else: # pass #if end if parm1=="": result=ix_grep(parm1,file,"=",'"',"#") #whole file into list, skip # #print("28 result:",result) print() print("30 list items:") # for item in result: #print out the list item=item.strip() print("item:"+item) #for end #print("36 List was made, exitting") return "end of List" #print("38 in Test....result:",result,":") else: pass #using the parm1 that was just read #if end #if end isSkipTheInputOnce =True #to use the parm1 just entered while True: #print("at 48") if isSkipTheInputOnce : isSkipTheInputOnce =False else: #print("at 52") parm1=input("?") if parm1=="": print("You must restart program to create the list") return parm1 #if end #if end #from ix_grep import ix_grep #purpose # D@CC uses the first mode result=ix_grep(parm1,file,"=",'"',"#")#one rec containing 1 value, skip # #result=ix_grep(parm1,file,"",'"',"#") #one rec ignore '"', skip # #result=ix_grep(parm1,file,"=",'"',"") #one record: whole record even # print(" ** result:",result) #end while return result #def end Test_ix_grep.py Doh=Test_ix_grep() print("70 Doh:",Doh) #/Text_ix_grep.py