/simple-Python-Statemachine

This code is an example for how to implement a simple State Machine using just standard Python (no library)

Primary LanguagePythonMIT LicenseMIT

simple Python State Machine

This code is an example for how to implement a simple State Machine using just standard Python (no library)

This State Machine supports :

  • all possible kinds of transitions
  • entry and exit methods
  • simple declarative code
  • easy modification of behavior
  • easy to understand
  • easy and intuitive to implement
  • variable delay in execution

Notes

when creating the functions for the states I named them differently [run0, run1, run2, ...]
As in python function-names are just variables you could just override the same function over and over.

If you like this give this repo a star