Skip to main content

All Questions

0 votes
1 answer
40 views

Differing behaviors in Popen.readline() between IDE and terminal runs

I have a Tkinter GUI program that I would like to update a text Frame on with output from a called process. I managed to make it work pretty well using threading and subprocess, with the 'run' button ...
Gareth's user avatar
  • 93
0 votes
1 answer
33 views

Python - Kill an Active Subprocess Running in its Own Thread

I have a Python application that starts a subprocess that runs a bash script in another thread and in a separate shell. Note that this script starts a REST service and thus it does not terminate until ...
Justin's user avatar
  • 137
1 vote
0 answers
42 views

Python subprocess stoud handling while other code is running

I want to build a python script that start a subprocess and launches a CLI command(the cli command can take hours to run), so I want the main python to continue, however deploy a watcher, that keeps ...
crazywolf's user avatar
0 votes
1 answer
66 views

Deadlock/hanging while reading from a subprocess's stderr in thread - with consideration of KeyboardInterrupt and SystemExit

I'm using Popen from Python's subprocess module to start a subprocess, and also running another thread to capture its standard error. I suspect that the Popen context hangs on exit of the context if ...
Michal Charemza's user avatar
0 votes
1 answer
1k views

Run a Python subprocess in parallel

I'm writing a Python program to automate tasks. My program executes another program, let's call it "program 1", with the command subprocess: subprocess.call(cmd, cwd=...
Nicolas B's user avatar
1 vote
1 answer
115 views

Why code stop working after os.system command?

I have this code: import os import threading def push_repository(): try: os.system('git add *') os.system('git commit -m "Automated commit"') os.system('git push') ...
Alexander Shestak's user avatar
0 votes
1 answer
652 views

Why isn't subprocess.run working in a seperate thread?

I'm using subprocess.run() to run a .txt file containing python code. That python code may contain a while loop. I need the rest of my code to run while that is running. The obvious way to do this is ...
anothanothaone's user avatar
0 votes
3 answers
3k views

How to run 2 functions in parallel using python?

I have a job which calls start_measure function that runs a while loop to read a counter & store its value in a list as a separate process Then I run a workload for some time in parallel How can I ...
user2077648's user avatar
0 votes
2 answers
389 views

Keep a class running in a python subprocess or thread or process

I am using Squish to automate a Qt-based GUI application. I look up qt objects in the application recursively. Since it's time-intensive, I would like to cache objects once found for later reuse. I ...
shashank singh's user avatar
1 vote
3 answers
3k views

How to asynchronously call a shell script from Python?

I have a shell script which does some processing over the string passed and then writes it to a file. However I don't want my function foo() to wait for it to complete the operation. How do I call ...
malfoytool's user avatar
0 votes
1 answer
140 views

Python 3 interacting with subprocess via UDP on Raspberry Pi

I want to warm up raspistill via a subprocess call triggered via UDP and then at a desired time trigger image capture via a separate UDP command: UDP_listener() as thread 1: if data == "PRIME&...
Too Long Din't Read's user avatar
0 votes
0 answers
303 views

Make focus stacking work faster in Python

I am trying to run tufuse from python using subprocess.call to merge several layers of images and create one focus stack image. The input images are huge and take 20 min on my PC (12 cores, 64 G RAM) ...
Sina ALizadeh's user avatar
3 votes
2 answers
1k views

Python: running many subprocesses from different threads is slow

I have a program with 1 process that starts a lot of threads. Each thread might use subprocess.Popen to run some command. I see that the time to run the command increases with the number of threads. ...
Bob Sacamano's user avatar
0 votes
0 answers
60 views

Read from Popen object's stdout while it's running

I'm trying to capture the stdout of a Popen object while it's running and display this data on a gui and log it. However whenever I try and read from the stdout attribute my program freezes. Minimal ...
ryanh153's user avatar
  • 205
0 votes
0 answers
354 views

Python hangs with subprocess

I am having some issues figuring out why my code is hanging. I cannot reproduce it with a simple code, but I made a sample code on what/how the flow works. Basically the main process opens a ...
user1179317's user avatar
  • 2,923

15 30 50 per page
1
2 3 4 5 6