diff --git a/tuhi/util.py b/tuhi/util.py index 766d2cd..79fe599 100644 --- a/tuhi/util.py +++ b/tuhi/util.py @@ -12,13 +12,13 @@ # -def list2hex(l, groupsize=8): +def list2hex(lst, groupsize=8): '''Converts a list of integers to a two-letter hex string in the form "1a 2b c3"''' slices = [] - for idx in range(0, len(l), groupsize): - s = ' '.join([f'{x:02x}' for x in l[idx:idx + groupsize]]) + for idx in range(0, len(lst), groupsize): + s = ' '.join([f'{x:02x}' for x in lst[idx:idx + groupsize]]) slices.append(s) return ' '.join(slices) diff --git a/tuhi/wacom.py b/tuhi/wacom.py index e2da4f1..348f44d 100644 --- a/tuhi/wacom.py +++ b/tuhi/wacom.py @@ -113,10 +113,10 @@ def b2hex(bs): return ' '.join([''.join(s) for s in zip(hx[::2], hx[1::2])]) -def list2hexlist(l): +def list2hexlist(lst): '''Converts a list of integers to a two-letter prefixed hex string in the form "[0x1a, 0x32, 0xab]"''' - return '[' + ', '.join([f'{x:#04x}' for x in l]) + ']' + return '[' + ', '.join([f'{x:#04x}' for x in lst]) + ']' class DataLogger(object):