diff --git a/oshipka/util/__init__.py b/oshipka/util/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/oshipka/util/os.py b/oshipka/util/os.py new file mode 100644 index 0000000..637e8b3 --- /dev/null +++ b/oshipka/util/os.py @@ -0,0 +1,19 @@ +import subprocess + + +def run_cmd(command): + process = subprocess.Popen(command.split(), + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + universal_newlines=True, + ) + return '\n'.join([str(line) for line in iter(process.stdout.readline, '')]) + + +def print_cmd(command): + for line in run_cmd(command): + print(line, end='') + + +if __name__ == "__main__": + print_cmd("env") \ No newline at end of file