Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #11095 > unrolled thread
| Started by | "Danny Wong (dannwong)" <dannwong@cisco.com> |
|---|---|
| First post | 2011-08-10 01:38 -0500 |
| Last post | 2011-08-10 12:09 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
subprocess.Popen and thread module "Danny Wong (dannwong)" <dannwong@cisco.com> - 2011-08-10 01:38 -0500
Re: subprocess.Popen and thread module Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2011-08-10 12:09 +0200
| From | "Danny Wong (dannwong)" <dannwong@cisco.com> |
|---|---|
| Date | 2011-08-10 01:38 -0500 |
| Subject | subprocess.Popen and thread module |
| Message-ID | <mailman.2086.1312958350.1164.python-list@python.org> |
Hi All, I'm trying to execute some external commands from multiple database. I'm using threads and subprocess.Popen ( from docs, all the popen* functions are deprecated and I was told to use subprocess.Popen) to execute the external commands in parallel, but the commands seems to hang. My question is: Is subprocess.Popen thread safe? If not, what other module should I use to perform a system call? I also, want to log stdout and stderr to a file. Thanks.
[toc] | [next] | [standalone]
| From | Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> |
|---|---|
| Date | 2011-08-10 12:09 +0200 |
| Message-ID | <j1tldu$csg$1@r03.glglgl.eu> |
| In reply to | #11095 |
Am 10.08.2011 08:38 schrieb Danny Wong (dannwong): > Hi All, > I'm trying to execute some external commands from multiple database. > I'm using threads and subprocess.Popen ( from docs, all the popen* > functions are deprecated and I was told to use subprocess.Popen) to > execute the external commands in parallel, but the commands seems to > hang. > My question is: > Is subprocess.Popen thread safe? Do you really need threads here? As you just run those external commands (as far as I understand), it might be enough to start the commands, hold their object, read them out (maybe part for part) and then wait(). Thomas
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web