I want to create variables that hold the values packet.{name of the variable}. For example, I want sectID to get the value of packet.sectID. I've tried:
lst = ['sectID','MP_Sector_ID']
for field in lst:
globals()[field]=packet.field
but packet.field doesn't give me the right value. Also packet is a class.