tagged [subprocess]

Constantly print Subprocess output while process is running

Constantly print Subprocess output while process is running To launch programs from my Python-scripts, I'm using the following method: ``` def execute(command): process = subprocess.Popen(command, s...

7 Feb at 22:49

live output from subprocess command

live output from subprocess command I'm using a python script as a driver for a hydrodynamics code. When it comes time to run the simulation, I use `subprocess.Popen` to run the code, collect the outp...

running a command as a super user from a python script

running a command as a super user from a python script So I'm trying to get a process to be run as a super user from within a python script using subprocess. In the ipython shell something like ``` pr...

14 Apr at 18:28

How to catch exception output from Python subprocess.check_output()?

How to catch exception output from Python subprocess.check_output()? I'm trying to do a Bitcoin payment from within Python. In bash I would normally do this: So for example: If it is successful I get ...

3 Jul at 08:37

How do I pipe a subprocess call to a text file?

How do I pipe a subprocess call to a text file? RIght now I have a script that I run. When I run it and it hits this line, it starts printing stuff because run.sh has prints in it. How do I pipe this ...

16 Jul at 21:32

How to hide output of subprocess

How to hide output of subprocess I'm using eSpeak on Ubuntu and have a Python 2.7 script that prints and speaks a message: eSpeak produces the desired sounds, but clutters the shell with some errors (...

25 Sep at 18:20

OSError: [WinError 193] %1 is not a valid Win32 application

OSError: [WinError 193] %1 is not a valid Win32 application I am trying to call a Python file "hello.py" from within the python interpreter with subprocess. But I am unable to resolve this error. [Pyt...

11 Oct at 01:39

"OSError: [Errno 2] No such file or directory" while using python subprocess with command and arguments

"OSError: [Errno 2] No such file or directory" while using python subprocess with command and arguments I am trying to run a program to make some system calls inside Python code using `subprocess.call...

20 Jul at 12:9

How do I execute a program or call a system command?

How do I execute a program or call a system command? How do I call an external command within Python as if I had typed it in a shell or command prompt?

Actual meaning of 'shell=True' in subprocess

Actual meaning of 'shell=True' in subprocess I am calling different processes with the `subprocess` module. However, I have a question. In the following code: and Both work. After reading the docs, I ...

27 Dec at 01:6

How can I specify working directory for a subprocess

How can I specify working directory for a subprocess Is there a way to specify the running directory of command in Python's `subprocess.Popen()`? For example: My Python script is located in `C:\progra...

26 Jan at 08:46