Hello everybody,
I have the following problem:
This code works very well:
Thank you in advance !
I have the following problem:
This code works very well:
rm = visa.ResourceManager()
lakeshore = rm.open_resource('ASRL1::INSTR')
lakeshore.baud_rate = 1200
lakeshore.data_bits = 7
lakeshore.stop_bits = constants.StopBits.one
lakeshore.parity = constants.Parity.oddWhat I want is to write the same code but in diferent way:rm = visa.ResourceManager()
vars()["lakeshore"] = rm.open_resource('ASRL1::INSTR')which is works, but if I want to add some properties of the serial conection like:getattr(vars()["lakeshore"], "baud_rate") = "1200"
getattr(vars()["lakeshore"], "data_bits") = "7"
getattr(vars()["lakeshore"], "stop_bits") = getattr("constants.StopBits","one")
getattr(vars()["lakeshore"], "stop_bits") = getattr("constants.Parity","odd")The program give an error like:Error:Can't assign to function callI there a way to solve this problem ?Thank you in advance !
