0

In MATLAB you can do behave such as:

fldname = 'cost'; 
box.(fldname)  = 5;

Then box.cost will have 5

I would also want to read from box with something like the following:

val = box.(fldname) #where fldname is set somewhere else like above

Is there a similar ability in Python?

sedavidw
  • 11,116
  • 13
  • 61
  • 95

0 Answers0