From 09dc412527b735474f019b0a0695909a93603f91 Mon Sep 17 00:00:00 2001 From: Serhii Daniuk Date: Wed, 4 Oct 2017 21:17:49 +0300 Subject: [PATCH] Added method for method execution --- device.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/device.py b/device.py index 7827ec7..f930677 100644 --- a/device.py +++ b/device.py @@ -55,6 +55,9 @@ def go_red(self): self._write_pins(self.green_pins, 0) self._write_pins(self.red_pins, 1) + def run_method(self, method): + return locals()['%s' % method]() + def blink(self): for i in xrange(5): self.go_red()