I have this python code that reads through a list of tags then returns the tag list back to me in this format TW1,Quad_A,B,C or D wherever the opnum is found at
from itertools import product
def get_iterator(op_strings):
quads = ['A', 'B', 'C', 'D']
return product(range(1, 66), quads, op_strings)
shift = system.tag.readBlocking("[default]Twisters/Selected Shift From Assigner")[0].value
path = '[default]Twisters/TW{}/Operator Assignments/Quad_{} '+str(shift)+' Shift Operator {}'
paths = [path.format(*p) for p in get_iterator(['Name', 'BadgeNum'])]
tag_qvals = system.tag.readBlocking(paths)
opnum = self.props.text #'0008161371'
# Filter and extract TW and Quad from matching paths
matching_paths = [p for p, q in zip(paths, tag_qvals) if q.value == opnum]
for matching_path in matching_paths:
parts = matching_path.split('/')
twister_number = parts[1][2:] # Extract the number from 'TW1'
quad_part = parts[3].split()[0] # Get the Quad part before the space
self.getSibling("TextArea_3").props.text = ('TW{}, {}'.format(twister_number, quad_part))
When I print the result in the console I get a row for each output, in this case it looks like this:
TW1, Quad_B
TW1, Quad_C
TW1, Quad_D
BUT when I try and have that same returned to a label or textarea it returns only the last output, TW1,Quad_D.
How do i have return all the outputs?