Relative Content

Tag Archive for pythonsubprocess

subprocess.run() with capture_output=True

I am very new to Python. I am trying to run some shell commands via Python’s subprocess.run(). I would also like to capture the output of the shell commands. When I run the command with capture_output=False, it seems to run fine. But when I switch it to True, I get an error.

Subprocess without output when sleep is used

The code does not show any output, I have already tested several cases. If I remove the sleep function it works normally. I believe it is something related to the buffer, because after a while it shows normally