subprocess Questions

24

Solved

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 ...
Guideline asked 29/4, 2009 at 16:45

8

Solved

I want to use subprocess.check_output() with ps -A | grep 'process_name'. I tried various solutions but so far nothing worked. Can someone guide me how to do it?
Caruncle asked 11/11, 2012 at 14:55

1

Solved

Since the pre-commit hook does not allow even warnings and commits issued by bandit, I need to find a way to execute bash commands from python scripts without bandit complaining. Using the subproc...
Hive asked 25/2, 2022 at 9:2

14

Solved

I'm attempting to use the python subprocess module to log in to a secure ftp site and then grab a file. However I keep getting hung up on just trying to send the password when it is requested. I so...
Missi asked 5/3, 2010 at 15:16

5

Solved

I'm launching a number of subprocesses with subprocess.Popen in Python. I'd like to check whether one such process has completed. I've found two ways of checking the status of a subprocess, but bot...
Dropping asked 7/4, 2017 at 9:25

1

Solved

If you readline() from sys.stdin, passing the rest of it to a subprocess does not seem to work. import subprocess import sys header = sys.stdin.buffer.readline() print(header) subprocess.run(['nl'...
Intrigante asked 13/4, 2023 at 5:4

3

Solved

I have code executing in a subprocess that is supposed to raise an exception. I would like to raise the same exception in the main process when the exception is returned from the subprocess (prefe...
Lowborn asked 3/10, 2014 at 10:23

4

Solved

I use Python 3.6.6 :: Anaconda, Inc. I try to use subprocess to call other python script. subprocess.run("python -V", shell=True) I tried this code but outcome is Python 2.7.12 My loca...
Materialism asked 13/8, 2018 at 9:58

2

Solved

I'm trying to copy files from one location to another using subprocess library and Popen method. When runing following script I'm getting the error cp: cannot stat /some/dev_path/*. I was told that...
Beecham asked 4/9, 2012 at 16:34

6

Solved

I would like to repeatedly execute a subprocess as fast as possible. However, sometimes the process will take too long, so I want to kill it. I use signal.signal(...) like below: ppid=pipeexe.pid...
Raffarty asked 11/11, 2010 at 19:35

2

I have a Python module for which I'm writing a tutorial using Sphinx including doctests. This module comes with a few helper programs. I would like to include those helper programs in the docum...

3

Solved

Python 3.11 ChromeDriver 107.0.5304.62 Chrome 107.0.5304.107 Selenium 4.6.0 Chromedriver console always shows when I try to build exe with pyinstaller. from selenium import webdriver from selen...
Jemimah asked 16/11, 2022 at 14:6

6

Solved

I have a script which calls another Python script by subprocess.Popen. But since I have arguments stored in variable(s) servers[server]['address'] servers[server]['port'] servers[server]['pass'] I...
Molarity asked 22/11, 2013 at 8:21

3

Solved

I'm working with Python 2.7 on Windows 8/XP. I have a program A that runs another program B using the following code: p = Popen(["B"], stdout=PIPE, stderr=PIPE) stdout, stderr = p.communi...
Shearwater asked 6/11, 2012 at 3:12

4

Solved

I can successfully redirect my output to a file, however this appears to overwrite the file's existing data: import subprocess outfile = open('test','w') #same with "w" or "a" as opening mode outf...
Serles asked 12/9, 2011 at 14:4

3

Solved

I'm trying to run shell commands using python by using subprocess module in the below code, but I don't why my script is throwing an error like below. Can someone help me what I'm missing? Tracebac...
Gatha asked 29/11, 2021 at 19:42

5

Solved

I'd like to use Python 2.6 on Windows to launch several separate command windows, each running their own Python script. The purpose is: these are clients, and I'm trying to load up the server with ...
Clariceclarie asked 5/10, 2012 at 12:19

8

Solved

On Windows, subprocess.Popen.terminate calls win32's TerminalProcess. However, the behavior I see is that child processes of the process I am trying to terminate are still running. Why is that? How...
Twocycle asked 5/8, 2009 at 0:53

4

I am currently trying to write (Python 2.7.3) kind of a wrapper for GDB, which will allow me to dynamically switch from scripted input to interactive communication with GDB. So far I use self.pr...
Restricted asked 18/6, 2015 at 20:26

3

Solved

I'm writing a Python program for running user-uploaded arbitrary (and thus, at the worst case, unsafe, erroneous and crashing) code on a Linux server. The security questions aside, my objective is ...
Shelba asked 7/8, 2013 at 15:30

2

I'd like to print every line of python script as it's being executed, as well as the log from the console as every line is being executed. For example, for this script: import time print 'hello'...
Arrogate asked 28/4, 2017 at 18:31

5

I'm trying to make a non blocking subprocess call to run a slave.py script from my main.py program. I need to pass args from main.py to slave.py once when it(slave.py) is first started via subproce...
Kuomintang asked 17/4, 2013 at 23:15

9

Solved

I want to gzip a file in Python. I am trying to use the subprocss.check_call(), but it keeps failing with the error 'OSError: [Errno 2] No such file or directory'. Is there a problem with what I am...
Potshot asked 16/11, 2011 at 18:25

4

Solved

I've got an interactive program called my_own_exe. First, it prints out alive, then you input S\n and then it prints out alive again. Finally you input L\n. It does some processing and exits. Howe...
Inandin asked 9/3, 2010 at 11:35

3

Solved

Printing the output of a subprocess while saving the result is not a new problem, and has been answered many times before e.g.: https://mcmap.net/q/25515/-constantly-print-subprocess-output-while-p...
Twopiece asked 1/7, 2019 at 12:4

© 2022 - 2024 — McMap. All rights reserved.