Linked Questions

0 votes
0 answers
254 views

I'm currently facing a strange problem. I would like to manage the execution of this simple binary with Python: int main() { char test[5]; printf("Reading\n"); fgets(test, 5, ...
gagou7's user avatar
  • 313
1 vote
0 answers
58 views

I'm on Windows 10. I have a program written in c, that simply prints to the stdout and sleeps between prints, emulating some real work. I try to call this program from python (3.7.7) using asyncio and ...
645 votes
33 answers
343k views

I'm using the subprocess module to start a subprocess and connect to its output stream (standard output). I want to be able to execute non-blocking reads on its standard output. Is there a way to make ...
98 votes
7 answers
111k views

I'm using Python's subprocess.communicate() to read stdout from a process that runs for about a minute. How can I print out each line of that process's stdout in a streaming fashion, so that I can ...
47 votes
11 answers
15k views

I'd like to use the subprocess module in the following way: create a new process that potentially takes a long time to execute. capture stdout (or stderr, or potentially both, either together or ...
Ryan's user avatar
  • 4,299
32 votes
4 answers
46k views

The task I try to accomplish is to stream a ruby file and print out the output. (NOTE: I don't want to print out everything at once) main.py from subprocess import Popen, PIPE, STDOUT import pty ...
vermin's user avatar
  • 1,099
23 votes
4 answers
30k views

I want to run many processes in parallel with ability to take stdout in any time. How should I do it? Do I need to run thread for each subprocess.Popen() call, a what?
sashab's user avatar
  • 1,564
9 votes
4 answers
16k views

I am trying to assign the output of a command to a variable without the command thinking that it is being piped. The reason for this is that the command in question gives unformatted text as output if ...
13 votes
1 answer
11k views

proc = subprocess.Popen(['start'],stdin=subprocess.PIPE,stdout=subprocess.PIPE) proc.stdin.write('issue commands') proc.stdin.write('issue more commands') output = proc.stdout.read() # Deadlocked ...
5 votes
2 answers
10k views

is there a "nice" way to iterate over the output of a shell command? I'm looking for the python equivalent for something like: ls | while read file; do echo $file done Note that 'ls' is only an ...
6 votes
1 answer
15k views

There are two programs - parent.py and myscript.py, shown below. parent.py keeps printing messages in the console. And myscript.py needs access to what parent.py prints. parent.py: import time ...
5 votes
3 answers
7k views

I'm currently rewriting a little wrapper program in python that I once wrote in C++. It extracts files from a file and boxes them in another format. In C++ the output from the system commands I need ...
Basil's user avatar
  • 889
4 votes
2 answers
15k views

I have a problem, I need to read from a console output in real time. I have a file that I need to execute, tried doing something like this test.exe > text.txt but when I try to read while exe file ...
10 votes
3 answers
8k views

I'm trying to process both stdout and stderr from a subprocess.Popen call that captures both via subprocess.PIPE but would like to handle the output (for example printing them on the terminal) as it ...
alfredodeza's user avatar
  • 5,228
5 votes
1 answer
11k views

Thanks in advance for any help. I am fairly new to python and even newer to html. I have been trying the last few days to create a web page with buttons to perform tasks on a home server. At the ...
ButtzyB's user avatar
  • 77

15 30 50 per page
1
2 3 4