Linked Questions

187 votes
24 answers
208k views

I am trying to write a wrapper script for a command line program (svnadmin verify) that will display a nice progress indicator for the operation. This requires me to be able to see each line of ...
Chris Lieb's user avatar
  • 3,856
99 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 ...
Heinrich Schmetterling's user avatar
7 votes
1 answer
3k views

My Python script will run a bunch of shell scripts that output either 200 SOLUTIONS_REVISION or 400 SOLUTIONS_REVISION when run. The 200 in the output indicates success and the 400 indicates failure. ...
user avatar
2 votes
4 answers
3k views

I just want to use os.system("dir") and also be able to save the text outputted to a variable. I tried using sys.stdout.read() but running sys.stdout.readable() returns False. Do you know how I can ...
TheTypoIsIntentoinal's user avatar
0 votes
2 answers
4k views

How can I receive input from the terminal in Python? I am using Python to interface with another program which generates output from user input. I am using subprocess.Popen() to input to the program, ...
Jonathan Ginsburg's user avatar
1 vote
1 answer
2k views

I am trying to run a subprocess in Python 3 and constantly read the output. In the documentation for subprocess in Python 3 I see the following: Popen.wait(timeout=None) Wait for child process ...
Startec's user avatar
  • 13.4k
0 votes
1 answer
2k views

Possible Duplicate: read subprocess stdout line by line I wrote a C++ program that generates all bunch of text in the Linux console. I am using a python script to parse the output of this C++. I ...
Johny19's user avatar
  • 5,632
0 votes
0 answers
685 views

guys.I want to use Flask that runs a shell script and displays its output in a web page. The thing is when I run the script, i want the page to display the output of every command in that script so ...
NathanXu's user avatar
0 votes
0 answers
261 views

As part of a long pipeline (all orchestrated in Python), I'm calling an external program using the subprocess module. This program takes a while to finish, so I'd like to show the user a nice progress ...
Draconis's user avatar
  • 3,547
0 votes
1 answer
116 views

I want my program to launch some other program and somehow receive all of it's printing output. The bash/terminall/shell (not sure about my terminology here) does exactly that - you tell it what ...
user3496846's user avatar
  • 1,685
0 votes
1 answer
113 views

I am using subprocess.poll to read the status of standard out and error. while subprocess.poll() is None : out = subprocess.stdout.readline() print out Process comes out of loop before ...
cripki's user avatar
  • 1
1 vote
0 answers
53 views

I'm using terminal bluetooth client to scan for BLE devices. When I encounter a device by name 'Ac2', I would like to stop searching (stop Popen and continue in my code) and read the particular line ...
Viraj Khatri's user avatar
1638 votes
14 answers
1.2m views

How do I force Python's print function to flush the buffered output to the screen? See also: Disable output buffering if the goal is to change the buffering behaviour generally. This question is ...
Walter Nissen's user avatar
695 votes
16 answers
434k views

Is output buffering enabled by default in Python's interpreter for sys.stdout? If the answer is positive, what are all the ways to disable it? Suggestions so far: Use the -u command line switch Wrap ...
Eli Bendersky's user avatar
54 votes
6 answers
144k views

There is an interesting option in Ipython Jupyter Notebook to execute command line statements directly from the notebook. For example: ! mkdir ... ! python file.py Moreover - this code can be run ...
Dimgold's user avatar
  • 2,954

15 30 50 per page
1
2 3 4 5