Good day.

for items in sheet['B%s' %(counter):'D%s' %(counter)]: for iitems in items: toreturn = iitems.value 

Where iitems.value = such a tuple:

 Text1 12345 Text3 

It is necessary to display each element of the tuple in a separate variable. The commonplace iitems.value [0] displays only the first letter of the first word in a tuple. I would be grateful for the help.

On the advice I tried this method, but the int value hinders ('int' object has no attribute 'splitlines')

 for iitems in items: for line in iitems.value.splitlines(): print(line) 

PS If you translate the list - it turns out ['T', 'e', ​​'x', 't', '1'] which, to put it mildly, does not work either.

    1 answer 1

     val1 = '''Text1 12345 Text3''' a, b, c, *d = tpl = tuple(val1.split()) print(tpl) print(a, b, c, d) val2 = 'Text1', 12345, 'Text3', 123, 321 a, b, c, *d = val2 print(a, b, c, d) 

    out:

     ('Text1', '12345', 'Text3') Text1 12345 Text3 [] Text1 12345 Text3 [123, 321] 
    • I did everything as it is written - as soon as it comes to an int value - immediately 'int' object has no attribute 'split'. Just some trouble. - S. Stuart
    • give a real example, the type of data unpacked from tupple elements does not matter for unpacking - vadim vaduxa