Checks whether an external signal to terminate the running script has been set.
This function is intended for use in Python scripts that run in an endless loop; it allows the script to periodically check if it should exit the loop.
planetcnc.terminate()
#! /usr/bin/env python import planetcnc import time while True: # Perform work... # Check for termination signal if planetcnc.terminate(): print("Termination signal received. Exiting loop.") break time.sleep(0.1) # Pause briefly between checks