**************************** show("aa",1) Description **************************** #by: D@CC #date: 2021FJun26 #updated: 2022BFeb23 # # NB beware: the variable name must be in quotes # # This is a python debugging aide. # Often, when debugging, it is very helpful to list the type # and value of variables at various stages of execution. # Even listing a comment string at crucial points is of help # This routine is designed to be turned on/off near the beginning # of the program. If arg2 is 0, no variables will be shown # unless an error condition exists (e.g. a variable is not defined). # if arg2 is 0, the program will not print any extraneous output. # If arg2 is 1, the program will print all debugging information. # Of course putting a "#" in front of a show() statement will # suppress it. Note that "continueDoh=0" or "pass" can be # inserted in an empty clause of an IF statement. # #tested ok # stored in /home/pi/Desktop/Python_new/ix_py_test/ # stored in C:/ . . . /155/ # useful for debugging Python code # prints the name of the class of "a", "a" itself and value # precede by p=0 (at top of code) to suppress showing valid variables # it will still do the error checking and report errors #these all are analysed correctly #abcd="a123b" #abcd=25 #abcd=0b110 #abcd=0x101 #abcd=25.3 #abcd=25E5 #0.1 #"0.1.2.3" !doh #abcd="-h" #blah=["a","b","c"] #abcd=True #"None" #abcd="Null" #"-h" #"Null" #"xyz" when not yet defined # eg blah=123 # p=1 #set p=0 to suppress printing # show("blah",p) # prints blah: 123 # Note without "try" produced system error if variable blah is not defined # abcd= 25 or "a123b" /show.txt