Execute external command
>>> from py_cmd_exec import CMDExec
>>> exec = CMDExec(['date', '+%F'])
>>> exec.execute()
INFO:py_cmd_exec:executing ['date', '+%F']
DEBUG:py_cmd_exec:attempting blocking execution of ['date', '+%F']
(0, ['date', '+%F'], '2017-06-27\n', '')
>>>
See Security Considerations of subprocess
module.
You are more then welcome to fork it and contribute by creating pull requests. In case of any other need, please let me know.
Please make sure your code is compliant with PEP8 standard, with some tweaks allowed:
- E402 - in tests, module-level imports not being placed at the top of the source file are fine.
- E501 - maximum line length is set to 92 characters (more practical and still tidy / readable)
- E265 - it is OK to comment code without adding space after
#