Process (version 0.0.1)
index
Process.html

This package implements tools to build python package and tools.
 
>>> for line, error, code in real_time_process_output("./program1 && ./program2", shell=True): print(line)
...
b"<output line 1>"
b"<output line 2>"
b"<output line ...>"
b"<output line n>"
>>> print(code, error)
0, b"<error lines>"
>>> for line, error, code in real_time_process_output('python -c "print(input());print(input())"', input=b'test\n', timeout=2, shell=True): print(line)
...
b'test\n'
>>> print(code, error)
1 b'Traceback (most recent call last):\r\n  File "<string>", line 1, in <module>\r\nEOFError: EOF when reading a line\r\n'
>>> for line, error, code in real_time_process_output('python -c "print(input());print(input())"', input=b'test\ntest2\n', timeout=2, shell=True): print(line)
...
b'test\r\n'
b'test2\r\n'
>>> print(code, error)
0 b''
>>>

 
Functions
       
real_time_process_output(*args, input: bytes = b'', timeout: int = 0, **kwargs) -> collections.abc.Iterator[typing.Tuple[bytes, bytes, int]]
This function returns lines of process in real time.
 
args and kwargs are sent to subprocess.Popen.

 
Data
        __all__ = ['real_time_process_output']
__author_email__ = 'mauricelambert434@gmail.com'
__copyright__ = '\nPythonToolsKit Copyright (C) 2022 Maurice Lam...ome to redistribute it\nunder certain conditions.\n'
__description__ = '\nThis package implements tools to build python package and tools.\n'
__license__ = 'GPL-3.0 License'
__maintainer__ = 'Maurice Lambert'
__maintainer_email__ = 'mauricelambert434@gmail.com'
__url__ = 'https://github.com/mauricelambert/PythonToolsKit'

 
Author
        Maurice Lambert