Python openhtf: Dynamically get Measurerements name

In openhtf there is this very complex Measurement class, which has all the variables that need to be recorded for each test case. Rather than assigning them 1 by 1:

test.measurements.variableA = results["variableA"]

I would like to assign the results dict to the measurements directly. I can’t find a way to do that. So my question is how to do this

for key in results:
    test.measurements.(key) = results[key]

Nothing works neither exec nor globals. So is there a way to do this or do I have to live with the 1st one? Thanx

  • Please provide a minimum reproducible example

    – 

  • Not possible the openhtf framework is complex and quite big, I can’t provide an example.

    – 

  • I guess that makes it impossible to provide help.

    – 

  • What I am looking for is sth like this: global()[test.measurements][key]

    – 

Leave a Comment