I am a total novice at Python, and have come across a piece of code that confuses me.
ts, pkt2 = capPort2.wait(1, 45)[0]
The previous line
This means that return value of the wait function is either list or tuple and 0 it is an index of the element from this output. For example:
def func(numericValue):
return list(str(numericValue))
res = func(1000)
res[0] - > 1
Or:
def convert(value, to_type):
#do something
return resuls, convertedValue
res = convert(1100, str)
res[0] - > True