On 1/10/25 12:53, Thomas Passin via Python-list wrote:
On 1/10/2025 4:00 PM, Tim Johnson via Python-list wrote:
On 1/10/25 11:32, MRAB via Python-list wrote:
,,, snipped
Below is the pertinent code:
Popen(choice, stdout=PIPE, stderr=PIPE,
stdin=PIPE, close_fds=True)
On 1/10/2025 4:00 PM, Tim Johnson via Python-list wrote:
On 1/10/25 11:32, MRAB via Python-list wrote:
,,, snipped
Below is the pertinent code:
Popen(choice, stdout=PIPE, stderr=PIPE,
stdin=PIPE, close_fds=True)
My guess is my argument list is either insufficient or
I just tried this:
>>> import subprocess
>>> subprocess.run('which audacity', shell=True)
/usr/bin/audacity
CompletedProcess(args='which audacity', returncode=0)
>>> proc = subprocess.Popen('/usr/bin/audacity',
stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PI
On 1/10/25 11:32, MRAB via Python-list wrote:
,,, snipped
Below is the pertinent code:
Popen(choice, stdout=PIPE, stderr=PIPE,
stdin=PIPE, close_fds=True)
My guess is my argument list is either insufficient or an argument is
causing the problem, but am unsure of which
On 2025-01-10 19:15, Tim Johnson via Python-list wrote:
Using Python 3.12.3 on Ubuntu 24.04
I've converted a legacy python2 script to python3. All went well.
However, a glitch from python2 remains.
The script uses dmenu to create menus to pick applications. Applications
are then invoked from py
On 8/21/22, simone zambonardi wrote:
> Hi, I am running a program with the punishment subrocess.Popen(...) what I
> should do is to stop the script until the launched program is fully open.
> How can I do this? I used a time.sleep() function but I think there are
> other ways. Thanks
In Windows,
On Mon, 22 Aug 2022 at 13:41, Dan Stromberg wrote:
>
>
>
> On Sun, Aug 21, 2022 at 2:05 PM Chris Angelico wrote:
>>
>> On Mon, 22 Aug 2022 at 05:39, simone zambonardi
>> wrote:
>> >
>> > Hi, I am running a program with the punishment subrocess.Popen(...) what I
>> > should do is to stop the scr
On Sun, Aug 21, 2022 at 2:05 PM Chris Angelico wrote:
> On Mon, 22 Aug 2022 at 05:39, simone zambonardi
> wrote:
> >
> > Hi, I am running a program with the punishment subrocess.Popen(...) what
> I should do is to stop the script until the launched program is fully open.
> How can I do this? I u
On Mon, 22 Aug 2022 at 05:39, simone zambonardi
wrote:
>
> Hi, I am running a program with the punishment subrocess.Popen(...) what I
> should do is to stop the script until the launched program is fully open. How
> can I do this? I used a time.sleep() function but I think there are other
> way
Sometimes, launching subprocesses can seem like punishment. I don't
think there is a standard cross-platform way to know when a launched
asynchronous process is "fully open" (i.e. fully initialized, accepting
user input).
On Sun, 2022-08-21 at 02:11 -0700, simone zambonardi wrote:
> Hi, I am runni
Ok, thanks. I've just created https://bugs.python.org/issue35305. /Henrik
On Fri, Nov 23, 2018 at 6:47 PM INADA Naoki wrote:
>
> Thank you for a very informative report.
>
> > PS. This is my first post to this list - please let me know if I
> > should send to another forum instead.
>
> Would you s
Thank you for a very informative report.
> PS. This is my first post to this list - please let me know if I
> should send to another forum instead.
Would you send this report to the issue tracker?
https://bugs.python.org/
--
INADA Naoki
--
https://mail.python.org/mailman/listinfo/python-list
On May 21, 2015 12:41 AM, "Thomas Rachel" <
nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa...@spamschutz.glglgl.de> wrote:
>
> Am 20.05.2015 um 18:44 schrieb Robin Becker:
>
>> not really, it's just normal to keep event routines short; the routine
>> which beeps is after detection of the cat's entrance
Am 20.05.2015 um 18:44 schrieb Robin Becker:
not really, it's just normal to keep event routines short; the routine
which beeps is after detection of the cat's entrance into the house and
various recognition schemes have pronounced intruder :)
You could add a timed "cleanup" routine which .wai
On 20/05/2015 16:42, Alain Ketterlin wrote:
Robin Becker writes:
.
The code I used to use with os.spawnl was even worse in leaving
zombies around.
For the same reason (os.wait() and os.waitpid() let you ... wait for
child-processes).
I suppose I needed to keep a record of all t
Robin Becker writes:
> As part of a long running PyQT process running as a window app in Arch
> linux I needed an alert sound, I decided to use the beep command and
> the app code then looked like
>
> pid = Popen(['/home/robin/bin/mybeep', '-r3', '-f750', '-l100', '-d75']).pid
>
> the mybeep scri
Op Wednesday 20 May 2015 15:16 CEST schreef Robin Becker:
> As part of a long running PyQT process running as a window app in
> Arch linux I needed an alert sound, I decided to use the beep
> command and the app code then looked like
>
> pid = Popen(['/home/robin/bin/mybeep', '-r3', '-f750', '-l10
* Jerry Hill [130830 07:48]:
> On Fri, Aug 30, 2013 at 11:32 AM, Tim Johnson wrote:
> > The objective is to display all output, but to also separate error
> > messages from normal output.
>
> I still think you want to use communicate(). Like this:
>
> p = subprocess.Popen(args,stderr=subpr
* Nobody [130830 06:55]:
> On Thu, 29 Aug 2013 17:00:21 -0800, Tim Johnson wrote:
>
> > ## This appears to be what works.
> > def __exec(self,args) :
> > """Run the process with arguments"""
> >p =
> >subprocess.Popen(args,stderr=subprocess.PIPE,stdout=subprocess.PIPE)
On Fri, Aug 30, 2013 at 11:32 AM, Tim Johnson wrote:
> The objective is to display all output, but to also separate error
> messages from normal output.
I still think you want to use communicate(). Like this:
p = subprocess.Popen(args,stderr=subprocess.PIPE,stdout=subprocess.PIPE)
output, e
On Thu, 29 Aug 2013 17:00:21 -0800, Tim Johnson wrote:
> ## This appears to be what works.
> def __exec(self,args) :
> """Run the process with arguments"""
>p =
>subprocess.Popen(args,stderr=subprocess.PIPE,stdout=subprocess.PIPE)
>while 1 :
>output
* Tim Johnson [130829 10:51]:
> using Python 2.7.1 on OS X 10.7.5
>
> I'm managing a process of drush using an instance of subprocess.Popen
<...>
## This appears to be what works.
def __exec(self,args) :
"""Run the process with arguments"""
p = subprocess.Popen(args,stderr=su
* MRAB [130829 11:04]:
> On 29/08/2013 19:34, Tim Johnson wrote:
> >could use some examples.
> >
> The subprocess will terminate when it has finished writing its output,
> but because you're not consuming any of the output (you're waiting for
> it to finish), the buffer fills up and blocks the sub
On Thursday 2013 August 29 11:34, Tim Johnson wrote:
> using Python 2.7.1 on OS X 10.7.5
>
> I'm managing a process of drush using an instance of subprocess.Popen
>
> The process has a '--verbose' option. When that option is passed as
> part of the initializer `args' argument, the process will hang
Tim Johnson
> using Python 2.7.1 on OS X 10.7.5
>
> I'm managing a process of drush using an instance of subprocess.Popen
>
> The process has a '--verbose' option. When that option is passed as
> part of the initializer `args' argument, the process will hang.
>
> It should be no surprise as drus
On 29/08/2013 19:34, Tim Johnson wrote:
using Python 2.7.1 on OS X 10.7.5
I'm managing a process of drush using an instance of subprocess.Popen
The process has a '--verbose' option. When that option is passed as
part of the initializer `args' argument, the process will hang.
It should be no su
On 01/09/2013 11:08 PM, Niklas Berliner wrote:
> I have a pipline that involves processing some data, handing the data to an
> external program (t_coffee used for sequence alignments in bioinformatics),
> and postprocessing the result. Since I have a lot of data, I need to run my
> pipeline in para
On Wed, Jan 18, 2012 at 1:14 AM, Mac Smith wrote:
> Hi,
>
> I am using subprocess.Popen to start a movie ripping command HandBrakeCLI. My
> server is 64bit ubuntu server and has 8 cores. When the command starts it
> uses all 8 cores upto 80%-100% and works fine, but after 270 seconds the cpu
>
On Wed, 18 Jan 2012 14:44:37 +0530, Mac Smith wrote:
> Hi,
>
> I am using subprocess.Popen to start a movie ripping command
> HandBrakeCLI. My server is 64bit ubuntu server and has 8 cores. When the
> command starts it uses all 8 cores upto 80%-100% and works fine, but
> after 270 seconds the cpu
Thank you very much.
Now I have written a little c++ programm which produces some ouput.
And now it works fine.
There is something wrong with 7zip.exe and the arglist with *.
Tonight I will go on and hunt the error.
It should be Python 2.7
#!/usr/bin/env python
PATH_TO_EXE = "C:/Users/yoic
On 09/12/2011 08:32, Ulrich Eckhardt wrote:
Am 08.12.2011 23:41, schrieb Frank van den Boom:
arglist = [PATH_TO_7ZIP,"a", "-sfx", archive_name, "*", "-r",
"-p",PASSWORD]
The "*" is resolved by the shell, this is not a wildcard that gets
passed to the program. At least not normally, your case m
Am 08.12.2011 23:41, schrieb Frank van den Boom:
arglist = [PATH_TO_7ZIP,"a", "-sfx", archive_name, "*", "-r",
"-p",PASSWORD]
The "*" is resolved by the shell, this is not a wildcard that gets
passed to the program. At least not normally, your case might be different.
if output:
print o
I didn't have Windows 7 right now, but that shouldn't happen with the
code you've given; when trimming code for posting, you should check that
the trimmed code still have the exact same problem.
Here is the hole code:
#!/usr/bin/env python
# little script to backup recursive a folder with 7z
On 12/09/2011 09:41 AM, Frank van den Boom wrote:
What can I do, to prevent pressing the return key?
I didn't have Windows 7 right now, but that shouldn't happen with the
code you've given; when trimming code for posting, you should check that
the trimmed code still have the exact same proble
On Tue, 16 Aug 2011 02:03:50 -0500, Danny Wong (dannwong) wrote:
> I'm executing a command which I want to capture the
> standard/stderr output into a file (which I have with the code below),
> but I also want the standard output to go into a variable so I can
> process the information for t
Am 16.08.2011 09:03 schrieb Danny Wong (dannwong):
Hi All,
I'm executing a command which I want to capture the
standard/stderr output into a file (which I have with the code below),
but I also want the standard output to go into a variable so I can
process the information for the next com
On Tue, Aug 16, 2011 at 12:03 AM, Danny Wong (dannwong)
wrote:
> Hi All,
> I'm executing a command which I want to capture the
> standard/stderr output into a file (which I have with the code below),
> but I also want the standard output to go into a variable so I can
> process the informat
Danny Wong (dannwong) wrote:
> cmd_output = subprocess.Popen(['scm', 'load', '--force',
> '-r', nickname, '-d', directory, project], stdout=subprocess.PIPE,
> stderr=subprocess.PIPE)
> status = cmd_output.wait()
If you redirect stdout and/or stderr to a pipe, you must wait for EOF
b
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
> From: Chris Rebert
>> On Tue, Aug 9, 2011 at 11:38 PM, Danny Wong (dannwong)
>> 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
Original Message-
From: ch...@rebertia.com [mailto:ch...@rebertia.com] On Behalf Of Chris Rebert
Sent: Tuesday, August 09, 2011 11:53 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)
>
> On Tue, Aug 9, 2011 at 11:38 PM, Danny Wong (dannwong)
> 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
>> exe
"In load status is: %s" % status + "\n"
except:
print "Error Executing %s" % command + "\n"
-Original Message-
From: ch...@rebertia.com [mailto:ch...@rebertia.com] On Behalf Of Chris Rebert
Sent: Tuesday, August 09, 2011 11:47 PM
To: Danny
On Tue, Aug 9, 2011 at 11:38 PM, Danny Wong (dannwong)
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
On Fri, Dec 17, 2010 at 17:57, Sebastian Alonso wrote:
> Hey everyone, I'm working on a script which uses subprocess to launch a
> bunch of installers, but I'm getting problems with .msi installers
> although .exe ones work fine. The output I get is this:
>
import subprocess
p = subproce
On Fri, Dec 17, 2010 at 5:57 PM, Sebastian Alonso
wrote:
> Hey everyone, I'm working on a script which uses subprocess to launch a
> bunch of installers, but I'm getting problems with .msi installers although
> .exe ones work fine. The output I get is this:
>
import subprocess
p = subpro
On Nov 12, 6:58 am, Lawrence D'Oliveiro wrote:
> In message
> <2cf9a225-7d1c-4490-8a62-807e79bdd...@n30g2000vbb.googlegroups.com>,
>
> Why not skip all the threads and just spawn all the processes in your main
> loop? Then after getting the SIGINT, send that signal to all your processes,
> and the
In message
<2cf9a225-7d1c-4490-8a62-807e79bdd...@n30g2000vbb.googlegroups.com>,
eraserix wrote:
> I try to control several process from a python script. Each process is
> started from a thread, the threads just wait() for the child to exit
> and can then be joined. Main waits for SIGINT. After i
In message
<7c5be6d7-5782-44ad-aae7-7f7bbc798...@n32g2000prc.googlegroups.com>, goodman
wrote:
> Though I'm still a little confused how, if subprocess.Popen is using
> os.execvp, it still maintains control of things like interrupts.
The implied point, being that we are spawning subprocesses, is
On Nov 4, 4:43 pm, Lawrence D'Oliveiro wrote:
> In message
> <0f1a17f4-b6a9-4e89-ac26-74b1098a0...@b19g2000prj.googlegroups.com>, goodman
> wrote:
>
> > Hi, I'm wondering why subprocess.Popen does not seem to replace the
> > current process, even when it uses os.execvp (according to the
> > docume
On Nov 4, 1:22 am, goodman wrote:
> Note: Our server is a Linux machine, but we're restricted to Python
> 2.4.
>
> Hi, I'm wondering why subprocess.Popen does not seem to replace the
> current process, even when it uses os.execvp (according to the
> documentation:http://docs.python.org/library/sub
In message
<0f1a17f4-b6a9-4e89-ac26-74b1098a0...@b19g2000prj.googlegroups.com>, goodman
wrote:
> Hi, I'm wondering why subprocess.Popen does not seem to replace the
> current process, even when it uses os.execvp (according to the
> documentation:
> http://docs.python.org/library/subprocess.html#s
On Aug 18, 12:37 pm, Albert Hopkins wrote:
> On Wed, 2010-08-18 at 06:58 -0700, Nan wrote:
> > Ah, I'd been told that there would be no conflict, and that this was
> > just reloading the configuration, not restarting Apache.
>
> > I do need the web app to instruct Apache to reload because just bef
On Wed, 2010-08-18 at 06:58 -0700, Nan wrote:
> Ah, I'd been told that there would be no conflict, and that this was
> just reloading the configuration, not restarting Apache.
>
> I do need the web app to instruct Apache to reload because just before
> this it's creating new VirtualHosts that need
On Aug 17, 8:14 pm, Albert Hopkins wrote:
> On Tue, 2010-08-17 at 12:55 -0700, Nan wrote:
> > Hi folks --
>
> > I have a Python script running under Apache/mod_wsgi that needs to
> > reload Apache configs as part of its operation. The script continues
> > to execute after the subprocess.Popen cal
On Tue, 2010-08-17 at 12:55 -0700, Nan wrote:
> Hi folks --
>
> I have a Python script running under Apache/mod_wsgi that needs to
> reload Apache configs as part of its operation. The script continues
> to execute after the subprocess.Popen call. The communicate() method
> returns the correct t
On Jun 14, 7:11 pm, Kushal Kumaran
wrote:
> On Mon, Jun 14, 2010 at 7:01 PM,hiral wrote:
> > Hi,
>
> > Do we have any facility to append file from Popen()/call(); see below
> > example...
>
> > 1 import subprocess
> > 2 f=open('log', 'w')
> > 3 ...# writing some log-into into log file
> > 4 p = su
On Mon, Jun 14, 2010 at 7:01 PM, hiral wrote:
> Hi,
>
> Do we have any facility to append file from Popen()/call(); see below
> example...
>
> 1 import subprocess
> 2 f=open('log', 'w')
> 3 ...# writing some log-into into log file
> 4 p = subprocess.Popen(cmd, stdout=f, stderr=f) # (Q)
> 5 ...# do
On Fri, 02 Apr 2010 10:17:55 +, Harishankar wrote:
> I am writing a small app which requires input using stdin to the
> subprocess.
>
> I use the following technique:
>
> proc = subprocess.Popen (cmdargs, stdin=subprocess.PIPE)
>
> proc.stdin.write ("Something")
> proc.stdin.flush ()
> ...
On Wed, 06 Jan 2010 19:05:40 -0800, Steven K. Wong wrote:
> Well, the example code at
> http://www.python.org/ ... /subprocess.html#replacing-shell-pipeline
> has the same issue:
> Perhaps the doc can be improved to remind folks to close p1.stdout if
> the calling process doesn't need it, unless
On Wed, 06 Jan 2010 11:39:37 -0800, Steven K. Wong wrote:
> Suppose now all the prog1.poll() calls/loop are replaced by a single
> prog1.wait(). Without the explicit prog1.stdout.close(), prog1.wait()
> will not return, so the calling process still hangs. Because calling
> prog1.wait() means that
Well, the example code at
http://www.python.org/doc/2.6.2/library/subprocess.html#replacing-shell-pipeline
has the same issue:
output=`dmesg | grep hda`
==>
p1 = Popen(["dmesg"], stdout=PIPE)
p2 = Popen(["grep", "hda"], stdin=p1.stdout, stdout=PIPE)
output = p2.communicate()[0]
After communicate
On Jan 6, 10:30 am, Nobody wrote:
> I think that you should close prog1.stdout here. Otherwise, there will
> be two readers on the pipe (the calling process and prog2). Even if one of
> them dies, there's always the possibility that the caller might eventually
> decide to read prog1.stdout itself.
On Tue, 05 Jan 2010 15:50:39 -0800, Steven K. Wong wrote:
> Below, I have a Python script that launches 2 child programs, prog1
> and prog2, with prog1's stdout connected to prog2's stdin via a pipe.
> (It's like executing "prog1 | prog2" in the shell.)
>
> If both child programs exit with 0, the
BTW, I'm using Python 2.6.2 on Linux.
--
http://mail.python.org/mailman/listinfo/python-list
On 12/18/2009 8:15 AM, Chris Withers wrote:
the order of the writes isn't preserved.
How can I get this to be the case?
You'll need to flush the std{out|err} or set them unbuffered; or you can
just forget about relying on std{out|err} being ordered per write-order.
--
http://mail.python
On 12/17/2009 5:33 PM, Chris Withers wrote:
exar...@twistedmatrix.com wrote:
libc is probably giving you line buffering when you use os.system
(because the child process inherits the parent's stdio, and the
parent's stdio is probably a pty, and that's the policy libc implements).
Interesting
On 18/12/2009 9:33 AM, Chris Withers wrote:
exar...@twistedmatrix.com wrote:
libc is probably giving you line buffering when you use os.system
(because the child process inherits the parent's stdio, and the
parent's stdio is probably a pty, and that's the policy libc implements).
Interesting
exar...@twistedmatrix.com wrote:
libc is probably giving you line buffering when you use os.system
(because the child process inherits the parent's stdio, and the parent's
stdio is probably a pty, and that's the policy libc implements).
Interesting, but do these assertions still hold true wh
On 09:56 pm, ch...@simplistix.co.uk wrote:
exar...@twistedmatrix.com wrote:
How can I get this to be the case?
You probably just need to flush stdout and stderr after each write.
You set them up to go to the same underlying file descriptor, but they
still each have independent buffering on t
exar...@twistedmatrix.com wrote:
How can I get this to be the case?
You probably just need to flush stdout and stderr after each write. You
set them up to go to the same underlying file descriptor, but they still
each have independent buffering on top of that.
Okay, but if I do:
os.system
On 09:15 pm, ch...@simplistix.co.uk wrote:
Hi All,
I have this simple function:
def execute(command):
process = Popen(command.split(),stderr=STDOUT,stdout=PIPE)
return process.communicate()[0]
..but my unit test for it fails:
from testfixtures import tempdir,compare
from unittest impo
Carl Banks wrote:
On May 7, 2:58 pm, norseman wrote:
If you don't like a lot of typing that obscures the process,
take a look at os.Popen2 Pg.39 or so in Lib.pdf for 2.5.2
In this case - the popen3 is probably your best bet.
I took a test run on "subprocess" a few months ago. My review:
exces
Øystein ;
Down below: change >yourPy.py to | yourPy.py
I just noticed the typo.
Sorry
Steve
norseman wrote:
Øystein Johansen (OJOHANS) wrote:
Hi,
I have problems understanding the subprocess.Popen object. I have a
iterative calculation in a process running and I want to pipe the
On May 7, 2:58 pm, norseman wrote:
> If you don't like a lot of typing that obscures the process,
> take a look at os.Popen2 Pg.39 or so in Lib.pdf for 2.5.2
> In this case - the popen3 is probably your best bet.
>
> I took a test run on "subprocess" a few months ago. My review:
> excessive typin
2009/5/7 Øystein Johansen (OJOHANS) :
> Hi,
>
> I have problems understanding the subprocess.Popen object. I have a
> iterative calculation in a process running and I want to pipe the output
> (stdout) from this calculation to a Python script.
>
> Let me include a simple code that simulates the cal
Øystein Johansen (OJOHANS) wrote:
Hi,
I have problems understanding the subprocess.Popen object. I have a
iterative calculation in a process running and I want to pipe the output
(stdout) from this calculation to a Python script.
Let me include a simple code that simulates the calculating p
In article <49899185$0$2861$ba620...@news.skynet.be>,
Helmut Jarausch wrote:
>
>These pipes are exposed as file-like objects which can be accessed via
>the stdin, stdout or stderr (resp.) attributes of an object of class
>subprocess.Popen .
Please file a doc request at bugs.python.org
--
Aahz (
En Sun, 01 Feb 2009 18:00:36 -0200, Andrew Parker
escribió:
On Sun, Feb 1, 2009 at 1:46 PM, Andrew Parker wrote:
I'm having some fun with Popen. I have the following line:
process = subprocess.Popen(command, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
print process.stdout
Under
Clovis Fabricio wrote:
2009/2/4 Helmut Jarausch :
EQ.stdout is the filelike object you're looking for.
communicate() grabs entire output at once so don't use it.
Thanks a lot, I haven't found that in the official documentation.
Helmut.
That would be a documentation bug.
Fortunately it is not
2009/2/4 Helmut Jarausch :
>> EQ.stdout is the filelike object you're looking for.
>> communicate() grabs entire output at once so don't use it.
> Thanks a lot, I haven't found that in the official documentation.
> Helmut.
That would be a documentation bug.
Fortunately it is not true. Here is it i
Clovis Fabricio wrote:
2009/2/4 Helmut Jarausch :
using e.g.
import subprocess
Package='app-arch/lzma-utils'
EQ=subprocess.Popen(['/usr/bin/equery','depends',Package],stdout=subprocess.PIPE)
EQ_output= EQ.communicate()[0]
EQ_output is a string containing multiple lines.
I'd prefer a file-like ob
2009/2/4 Helmut Jarausch :
> using e.g.
> import subprocess
> Package='app-arch/lzma-utils'
> EQ=subprocess.Popen(['/usr/bin/equery','depends',Package],stdout=subprocess.PIPE)
> EQ_output= EQ.communicate()[0]
> EQ_output is a string containing multiple lines.
> I'd prefer a file-like object, e.g. E
Chris Rebert wrote:
On Wed, Feb 4, 2009 at 1:22 AM, Helmut Jarausch wrote:
Hi,
using e.g.
import subprocess
Package='app-arch/lzma-utils'
EQ=subprocess.Popen(['/usr/bin/equery','depends',Package],stdout=subprocess.PIPE)
EQ_output= EQ.communicate()[0]
EQ_output is a string containing multiple
On Wed, Feb 4, 2009 at 1:22 AM, Helmut Jarausch wrote:
> Hi,
>
> using e.g.
> import subprocess
> Package='app-arch/lzma-utils'
> EQ=subprocess.Popen(['/usr/bin/equery','depends',Package],stdout=subprocess.PIPE)
> EQ_output= EQ.communicate()[0]
>
> EQ_output is a string containing multiple lines.
On Sun, Feb 1, 2009 at 1:46 PM, Andrew Parker wrote:
> I'm having some fun with Popen. I have the following line:
>
>process = subprocess.Popen(command, stdout=subprocess.PIPE,
> stderr=subprocess.STDOUT)
>print process.stdout
>
> Under normal circumstances, this displays:
>
>', mode
psaff...@googlemail.com wrote:
On 12 Jan, 15:33, mk wrote:
Better use communicate() method:
Oh yes - it's right there in the documentation. That worked perfectly.
What's also in the docs and I did not pay attention to before:
Note
The data read is buffered in memory, so do not use this m
On 12 Jan, 15:33, mk wrote:
>
> Better use communicate() method:
>
Oh yes - it's right there in the documentation. That worked perfectly.
Many thanks,
Peter
--
http://mail.python.org/mailman/listinfo/python-list
psaff...@googlemail.com wrote:
p = Popen(cmd, shell=True, bufsize=100, stdout=PIPE, stderr=PIPE)
output = p.stdout.read()
Better use communicate() method:
standardoutputstr, standarderrorstr = subprocess.communicate(...)
Never had any problem with subprocesses when using subprocess module in
On Mon, 12 Jan 2009 06:37:35 -0800 (PST), "psaff...@googlemail.com"
wrote:
I'm building a bioinformatics application using the ipcress tool:
http://www.ebi.ac.uk/~guy/exonerate/ipcress.man.html
I'm using subprocess.Popen to execute ipcress, which takes a group of
files full of DNA sequences a
On Dec 20, 7:06 pm, Aaron Brady wrote:
> On Dec 18, 7:21 pm, "Gabriel Genellina"
> wrote:
>
>
>
> > En Thu, 18 Dec 2008 19:46:45 -0200, Aaron Brady
> > escribió:
> snip
> > > Will it take calling
> > > 'CreatePipe' from ctypes directly if on Windows? Or can 'os.pipe' be
> > > made to abstract
On Dec 18, 7:21 pm, "Gabriel Genellina"
wrote:
> En Thu, 18 Dec 2008 19:46:45 -0200, Aaron Brady
> escribió:
snip
> On Windows, file handles are the real OS stuff, the "true" reference to an
> open file. File descriptors are not, they exist only to please the C
> runtime library. Programs n
On Dec 18, 6:11 pm, "Gabriel Genellina"
wrote:
> En Thu, 18 Dec 2008 08:35:58 -0200, Aaron Brady
> escribió:
>
>
>
> > On Dec 17, 7:16 pm, "Gabriel Genellina"
> > wrote:
> >> En Wed, 17 Dec 2008 22:46:32 -0200, Aaron Brady
> >> escribió:
>
> >> > On Dec 17, 5:05 pm, "Gabriel Genellina"
> >>
En Thu, 18 Dec 2008 19:46:45 -0200, Aaron Brady
escribió:
On Dec 17, 7:16 pm, "Gabriel Genellina"
wrote:
En Wed, 17 Dec 2008 22:46:32 -0200, Aaron Brady
escribió:
> On Dec 17, 5:05 pm, "Gabriel Genellina"
> wrote:
>> En Wed, 17 Dec 2008 12:21:38 -0200, Jeremy Sanders
>> escribió:
En Thu, 18 Dec 2008 08:35:58 -0200, Aaron Brady
escribió:
On Dec 17, 7:16 pm, "Gabriel Genellina"
wrote:
En Wed, 17 Dec 2008 22:46:32 -0200, Aaron Brady
escribió:
> On Dec 17, 5:05 pm, "Gabriel Genellina"
> wrote:
>> En Wed, 17 Dec 2008 12:21:38 -0200, Jeremy Sanders
>> escribió:
>
On Dec 17, 7:16 pm, "Gabriel Genellina"
wrote:
> En Wed, 17 Dec 2008 22:46:32 -0200, Aaron Brady
> escribió:
>
>
>
> > On Dec 17, 5:05 pm, "Gabriel Genellina"
> > wrote:
> >> En Wed, 17 Dec 2008 12:21:38 -0200, Jeremy Sanders
> >> escribió:
>
> >> > It would be nice if Python created pipes
On Dec 17, 7:16 pm, "Gabriel Genellina"
wrote:
> En Wed, 17 Dec 2008 22:46:32 -0200, Aaron Brady
> escribió:
>
>
>
> > On Dec 17, 5:05 pm, "Gabriel Genellina"
> > wrote:
> >> En Wed, 17 Dec 2008 12:21:38 -0200, Jeremy Sanders
> >> escribió:
>
> >> > It would be nice if Python created pipes
En Wed, 17 Dec 2008 22:46:32 -0200, Aaron Brady
escribió:
On Dec 17, 5:05 pm, "Gabriel Genellina"
wrote:
En Wed, 17 Dec 2008 12:21:38 -0200, Jeremy Sanders
escribió:
> It would be nice if Python created pipes that are properly
inheritable by
> default by child processes, as they're mos
On Dec 17, 5:05 pm, "Gabriel Genellina"
wrote:
> En Wed, 17 Dec 2008 12:21:38 -0200, Jeremy Sanders
> escribió:
>
> > Aaron Brady wrote:
>
> >> I thought so too. The web seems to say that on Linux they are, and on
> >> Windows, you need to call DuplicateHandle for it.
>
> Or set bInheritHandle
En Wed, 17 Dec 2008 12:21:38 -0200, Jeremy Sanders
escribió:
Aaron Brady wrote:
I thought so too. The web seems to say that on Linux they are, and on
Windows, you need to call DuplicateHandle for it.
Or set bInheritHandle=True when creating the pipe initially. os.pipe()
doesn't do that
1 - 100 of 168 matches
Mail list logo