terminate()

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.

Syntax

planetcnc.terminate()

Parameters

Parameter Type Description
None

Return Value

Examples

#! /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

See also

py_term()

ready
terminate
send_message
read_message