LinkToPy
LinkToPy copied to clipboard
terminating in a clean/thread safe manner
Are there any suggestions how a script should close down a LinkToPy session?
I see that the code starts up a new thread and runs (or attempts to) a Carabiner executable.
def start_carabiner(self, path_to_car):
print(path_to_car)
os.system(path_to_car +" >car_logs.log")
Is there a way to close/terminate this executable? Or a way to sense that there's already one running (TCP port??) and not (to attempt) to start a new one?
This now behaves a lot nicer with my 'toggle_bpm' example.
I have the _listener terminating when it can no longer talk to a Carabiner process, maybe the system should automatically attempt to reconnect, or fire up a Carabiner process of its self.