Created
January 26, 2020 04:11
-
-
Save geoffkoh/33138f0cb60852ca8cc29c1c3113cef0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class LocalExecutor(ExecutorBase): | |
| def run(self, command: str) -> (str, str): | |
| """ Runs the given command using subprocess """ | |
| args = shlex.split(command) | |
| stdout, stderr = subprocess.Popen(args, | |
| stdout=subprocess.PIPE, | |
| stderr=subprocess.PIPE).communicate() | |
| out = stdout.decode('utf-8') | |
| err = stderr.decode('utf-8') | |
| return out, err | |
| # end run() | |
| # end class LocalExecutor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment