So I have a function I want to run, however this function connects to a serial device, if the device was not turned off correctly it will return an error if you try to run such a function. Since I only need to run the function once all I want is to
try
#function
except
#function to turn off the device
#try again
not within a loop since I want to just run it once and keep going, is this possible in python without using a loop?
#try againwith#function?