exception handling - Multiple Try-Excepts followed by an Else in python -
Have several consecutive attempts been made in many ways? / P>
as an example:
Try: private.anodization_voltage_meter = Voltmeter (voltage_meter extension.value) #seign voltmeter excluding location (Visa.WiIiR): # Channel private time Try Vinod ('Volt meter is not on this channel or not)' Try: private.anodization_current_meter = Voltmeter (current_meter eter_address.value) #second Voltmeter except as current meter location (Visa .VISIOIOrror): #channel time .profile.logger Warning ('Ammeter is not on this channel or not)' Try: private.sample_thermometer = Voltmeter (sample_thermometer_address.value) Use the #WhyMeter as the thermomter location for the sample. Excluding (Visa. ViIaier): #Channel Out Of Private Time Logger Warning (try 'The sample thermometer is not on this channel or not)' Try: private.heater_thermometer = Voltmeter (heater_thermeter_address.value) # The voltmeter as the thermomter location for the heater. Excluding (Visa. ViIaier): #Channel Out Of Private Time Logger Warning ('Heater thermometer is not on this channel or not) and others: private.logger.info (' Initial Meters')
As you can see, you can only Meters started printing
, if all of them have been closed, although the currently written heater depends on the thermometer. Is there any way to bulk them?
You can keep a boolean, from the beginning to the beginning: everything OK = true < / Code> then set it to
incorrect
in all except the blocks and only log the last line.
Comments
Post a Comment