CrowdStrike Falcon CrowdStrike Subreddit

Showing a wait indicator

Documentation Version Page Updated

This helper provides developers with a simple class for adding a wait indicator to terminal output for long running code.

The Indicator class was first introduced in FalconPy v1.5.1.

Indicator types

IndicatorExample
clock
cylon
kitt
thinking
moon

Properties

This class provides the following properties.

PropertyReturnsData TypeMutable
indicatorCurrent indicator as a listList of stringsNo
positionCurrent position within the indicator listIntegerYes

Adding a wait indicator

The default indicator is moon. This can be changed by providing the style keyword argument to the Indicator class when you create an instance of the class.

Code example

This example will show the default indicator, moon.

from time import sleep
from falconpy import Indicator

wait = Indicator()
for x in range(0, 30):
    print(f" {wait}", end="\r")
    sleep(.25)

This example will show the clock indicator.

from time import sleep
from falconpy import Indicator

wait = Indicator(style="clock")
for x in range(0, 30):
    print(f" {wait}", end="\r")
    sleep(.25)

An example of this functionality in use can also be found in the source code of the HTTP Event Collector sample, "What the HEC?".