Linked Questions
75 questions linked to/from read subprocess stdout line by line
1 vote
1 answer
4k views
Get duration of .wav from sox in python
I know how to print the duration of the .wav file using sox at the Linux command. soxi -D input.wav So I used this syntax in python. subprocess.call(['soxi', '-D', input.wav]) But I'd like to save ...
0 votes
2 answers
4k views
Python interaction with PowerShell
I am a sysadmin and have been trying to get more in to coding. I really like using python so far and have been able to do a few cool things. However, one thing I am struggling with is the ability to ...
3 votes
1 answer
6k views
Reliable non blocking reads from subprocess stdout
Note: I have a process that writes one line to stdout ("print("hello")) and waits for raw_input. I run this process with p = subprocess.Popen, then call p.stdout.readline()....this blocks ...
3 votes
1 answer
3k views
Widget to Display subprocess stdout?
I have a python based tkinter script which executes some commands using subprocess module. I need to display the standard output on the GUI itself. Since I am new to tk (One week Bold :) ), I need ...
1 vote
2 answers
4k views
real time logging to file with python subprocess
I expect this is really simple but I can't work this out. I am trying to write to a log file in real time the output from a DD imaging subprocess - I'm using DD v 8.25 from which you can get regular ...
1 vote
1 answer
3k views
Execute cmd from python and get continuous output
here is my problem: I need to execute a cmd command from python, the command is not something that executes fast, it will be running for a longer period of time. What I need is a way to #1 execute the ...
2 votes
2 answers
1k views
web.py + subprocess = hang
Here's my main file: import subprocess, time pipe = subprocess.PIPE popen = subprocess.Popen('pythonw -uB test_web_app.py', stdout=pipe) time.sleep(3) And here's test_web_app.py: import web class ...
1 vote
3 answers
3k views
Get output continuously: rsync info=progress2 call in python script
I'm calling rsync with popen and the output is not printing out continuously in my python script for my web application as it does in just normal linux. I'm trying to copy over all the files on one ...
0 votes
1 answer
2k views
How to count no of lines we are getting from subprocess.popen command
I am writing a code wherein I am using subprocess.Popen Command to run a script on terminal that will retrieve some results from database . I may get single result from database or more than one ...
1 vote
2 answers
1k views
Loosing some std output reading from Python subprocess (Popen)
I have a program written in Python that at some point creates a subprocess and then has to get its std output in "real time" through a file (the process takes a while and some output is needed while ...
0 votes
1 answer
1k views
How to use python to extract data that is pushed to stdout?
I'm trying to do some scripting, but one of the utilities I have returns a value to stdout, where I would like to assign it to a variable. The utility (candump) is constantly running and only prints ...
0 votes
1 answer
2k views
reading STDERR of subprocess
I came across a problem when using subprocess.Popen. I went through the problem here. When I add the following edit to the fake_utility.py i.e add stderr=subprocess.PIPE in subprocess.Popen: #...
1 vote
1 answer
2k views
start cmd.exe from python and call a bat file with multiple parameters
I'd like to load cmd.exe and call a bat file with multiple parameters. All these from python. My bat file looks like: @echo off call ifortvars.bat intel64 cd %5 abaqus job=#1 user=%2 cpus=%3 ...
0 votes
2 answers
2k views
Interacting with slurm through python (to automatically chain jobs)
I need to run 10,000 jobs on slurm (each taking 30 minutes let's say). Currently, the plan was to do it with a job array, using 250 cores in parallel, like so: sbatch --array=0-10000%250 array_script....
0 votes
1 answer
2k views
Python tkinter Display CLI result on GUI
I have 2 python files. one is helloworld.py and 2nd is main.py. In main.py there is button.When i click on that button that time I want to print result of helloworld.py into text box. helloworld.py ...