summaryrefslogtreecommitdiff
path: root/examples/statemachine/trafficLightDemo.py
diff options
context:
space:
mode:
authorptmcg <ptmcg@austin.rr.com>2019-01-09 17:18:22 -0600
committerptmcg <ptmcg@austin.rr.com>2019-01-09 17:18:22 -0600
commitd626c99b6288afc4708d72f668b45a29d3263d22 (patch)
tree4cbeca134437387022e59b71631246e178393aca /examples/statemachine/trafficLightDemo.py
parente9ef507bf1fd41d4bd3ffb0c193e5889254ba340 (diff)
downloadpyparsing-git-d626c99b6288afc4708d72f668b45a29d3263d22.tar.gz
Add enumerated place holders for strings that invoke str.format(), for Py2 compatibility
Diffstat (limited to 'examples/statemachine/trafficLightDemo.py')
-rw-r--r--examples/statemachine/trafficLightDemo.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/statemachine/trafficLightDemo.py b/examples/statemachine/trafficLightDemo.py
index 4fc737c..4d70541 100644
--- a/examples/statemachine/trafficLightDemo.py
+++ b/examples/statemachine/trafficLightDemo.py
@@ -21,12 +21,12 @@ class TrafficLight:
return getattr(self._state, attrname)
def __str__(self):
- return "{}: {}".format(self.__class__.__name__, self._state)
+ return "{0}: {1}".format(self.__class__.__name__, self._state)
light = TrafficLight()
for i in range(10):
- print("{} {}".format(light, ("STOP", "GO")[light.cars_can_go]))
+ print("{0} {1}".format(light, ("STOP", "GO")[light.cars_can_go]))
light.crossing_signal()
light.delay()
print()