Hi Robin,admin wrote: ↑Mon Aug 20, 2018 6:58 pm How about
Basically this way your get_EV() function returns a value rather than trying to set a global variable (which I'm not sure would work), then you just use the value returned from the function - much cleaner.Code: Select all
def get_EV(): exp = SharpCap.SelectedCamera.Controls.Exposure.ExposureMs/1000 if exp > 50: return str(format(exp, '.0f')) + "(s)" else: return str(exp) def btnLE_Click(self, sender, event): if SharpCap.SelectedCamera != None: self.lbl.LEv.Text = get_EV() else: SharpCap.ShowNotification('No Camera Selected! Please Select A Camera.')
cheers,
Robin
thanks for replying
still getting the error: global name 'get_EV' is not defined though
Cheers
Kirk