Last active
July 29, 2017 07:19
-
-
Save Karn/fe44acaa18078f916fb12d4009d6ab10 to your computer and use it in GitHub Desktop.
Python State Machine - Example Output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python | |
Python 2.7.13 (default, Apr 4 2017, 08:47:57) | |
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.38)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> from simple_device import SimpleDevice | |
>>> device = SimpleDevice() | |
Processing current state: LockedState | |
>>> device.on_event('device_locked') | |
>>> device.on_event('pin_entered') | |
Processing current state: UnlockedState | |
>>> device.state | |
UnlockedState | |
>>> device.on_event('device_locked') | |
Processing current state: LockedState | |
>>> device.state | |
LockedState | |
>>> device.on_event('device_locked') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment