Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #11097
| Subject | RE: subprocess.Popen and thread module |
|---|---|
| Date | 2011-08-10 01:48 -0500 |
| References | <20110808013500.7c9e30ff44caee0f0bbf988a@johnohagan.com><D59C59453D0EDC43832490B6DADFAECF0432A191@XMB-RCD-214.cisco.com> <CAMZYqRSxAzLaea6aR0DNDnc-Jv3XWSPvo6cZdv4D0hcL5eeKTg@mail.gmail.com> |
| From | "Danny Wong (dannwong)" <dannwong@cisco.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2088.1312958991.1164.python-list@python.org> (permalink) |
Hi Chris,
Here is the code,
try:
cmd_output = subprocess.Popen(['scm', 'load', '--force', '-r', nickname, '-d', directory, project], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
status = cmd_output.wait()
print "In load status is: %s" % status + "\n"
except:
print "Error Executing %s" % command + "\n"
-----Original Message-----
From: chris@rebertia.com [mailto:chris@rebertia.com] On Behalf Of Chris Rebert
Sent: Tuesday, August 09, 2011 11:47 PM
To: Danny Wong (dannwong)
Cc: python-list@python.org
Subject: Re: subprocess.Popen and thread module
On Tue, Aug 9, 2011 at 11:38 PM, Danny Wong (dannwong)
<dannwong@cisco.com> wrote:
> 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.
What's your Popen() call look like?
Cheers,
Chris
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
RE: subprocess.Popen and thread module "Danny Wong (dannwong)" <dannwong@cisco.com> - 2011-08-10 01:48 -0500
csiph-web