summaryrefslogtreecommitdiff
path: root/examples/statemachine/trafficLightDemo.py
diff options
context:
space:
mode:
authorptmcg <ptmcg@austin.rr.com>2018-12-31 13:10:59 -0600
committerptmcg <ptmcg@austin.rr.com>2018-12-31 13:10:59 -0600
commite177e2feed1bfbe29f32c3378978313d19ce1c26 (patch)
tree45eed16a9965597827d8dc2031b1012d222fc842 /examples/statemachine/trafficLightDemo.py
parent5132a91c470a8b6c34c7f0525c0bf41b9365e817 (diff)
downloadpyparsing-git-e177e2feed1bfbe29f32c3378978313d19ce1c26.tar.gz
Add document signoff and library book state examples;
Diffstat (limited to 'examples/statemachine/trafficLightDemo.py')
-rw-r--r--examples/statemachine/trafficLightDemo.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/statemachine/trafficLightDemo.py b/examples/statemachine/trafficLightDemo.py
index ea42180..4fc737c 100644
--- a/examples/statemachine/trafficLightDemo.py
+++ b/examples/statemachine/trafficLightDemo.py
@@ -26,9 +26,8 @@ class TrafficLight:
light = TrafficLight()
for i in range(10):
- print(light, end=' ')
- print(("STOP", "GO")[light.carsCanGo])
- light.crossingSignal()
+ print("{} {}".format(light, ("STOP", "GO")[light.cars_can_go]))
+ light.crossing_signal()
light.delay()
print()