Script Control - PeterRyder/Check-Up GitHub Wiki

Scripting with Check Up

Check Up creates a scripts folder in the current working directory of the executable

Currently any python files in this folder will be listed in the Script Control window

These scripts can then be started or stopped within Check Up

Scripts currently need a main method and a close method

Example of main method:

def main():
    print("Hello World")

Example of close method:

def close():
    print("Closing")

The main method will be called when the script is started The close method will be called when the script is stopped

A while loop and a global variable can be combined to create a script which runs until you click the stop button

import time

def main():
    global should_run
    print("Running script...")

    should_run = True    

    while should_run:
        print("Hello World")
        time.sleep(1)

def close():
    global should_run
    print("Closing")
    should_run = False

A complete CPU Monitoring script is located within the example scripts folder here