> On 18 May 2020, at 21:50, Dick Holmes wrote:
snip
> Per Peter's suggestion I tried readline and it works "as expected". I
> also discovered that the reason the read operations were stalling was
> that they followed a write and the write doesn't actually occur until
> "flush" is called ev
pexpect
>
> https://pexpect.readthedocs.io/en/stable/index.html
>
> does this naturally, but I don't know if Windows support is sufficient for
> your needs.
>
> > I've looked at various mechanisms and the
> > class that seems to fit my needs is Popen in t
pexpect
>
> https://pexpect.readthedocs.io/en/stable/index.html
>
> does this naturally, but I don't know if Windows support is sufficient for
> your needs.
>
> > I've looked at various mechanisms and the
> > class that seems to fit my needs is Popen in t
On 5/13/2020 11:13 PM, Dick Holmes wrote:
https://occovid19.ochealthinfo.com/coronavirus-in-oc I'm trying to
communicate using a continuing dialog between two
processes on the same system
Try multiprocessing and pipes.
--
Terry Jan Reedy
--
https://mail.python.org/mailman/listinfo/python-lis
#x27;t know if Windows support is sufficient for
your needs.
> I've looked at various mechanisms and the
> class that seems to fit my needs is Popen in the subprocess module, but
> I can't seem to get more than a single round-trip message through Popen.
> I first call Popen
https://occovid19.ochealthinfo.com/coronavirus-in-oc I'm trying to
communicate using a continuing dialog between two
processes on the same system. I've looked at various mechanisms and the
class that seems to fit my needs is Popen in the subprocess module, but
I can't seem to
info.strip('||')
> print g_info
> print info
> fp.close()
> Error:
> AttributeError: 'Popen' object has no attribute 'read'
You have to specify the stream/file, e. g.
g_info.stdout.read()
but when want both stdout and stderr your rea
On Fri, Jan 4, 2019 at 10:16 PM wrote:
>
> On Thursday, January 3, 2019 at 9:40:43 PM UTC+1, Chris Angelico wrote:
> > On Fri, Jan 4, 2019 at 7:37 AM Mohan Mohta wrote:
> > > I am no expert in python but I found grep is lot faster in than the
> > > methods of reading files from python point
On Thursday, January 3, 2019 at 9:40:43 PM UTC+1, Chris Angelico wrote:
> On Fri, Jan 4, 2019 at 7:37 AM Mohan Mohta wrote:
> > I am no expert in python but I found grep is lot faster in than the methods
> > of reading files from python point me to direction if you know of
> > anything faste
On Fri, Jan 4, 2019 at 7:37 AM Mohan Mohta wrote:
> I am no expert in python but I found grep is lot faster in than the methods
> of reading files from python point me to direction if you know of
> anything faster I would appreciate it.
>
Try doing things the simple and easy way in Python,
On Thursday, January 3, 2019 at 1:49:31 PM UTC-6, Chris Angelico wrote:
> On Fri, Jan 4, 2019 at 6:46 AM Mohan Mohta wrote:
> >
> > Hello,
> > I am trying to grep the keyword (which I got from report_file ) from
> > report_file
> >
> > I tried multiple ways but am unable to get it to work.
>
> H
Agreeing with the other poster that it's probably not the best way to handle it.
But for the sake of helping with subprocess:
https://docs.python.org/3.7/library/subprocess.html#popen-objects
Popen Objects don't have read() as the error says. That's on their .stdout and
.std
On Fri, Jan 4, 2019 at 6:46 AM Mohan Mohta wrote:
>
> Hello,
> I am trying to grep the keyword (which I got from report_file ) from
> report_file
>
> I tried multiple ways but am unable to get it to work.
How about, instead, you simply open the file and iterate through it,
looking for the keywor
g_info=subprocess.Popen('cat report_file| grep -i '+var1,
stdout=subprocess.PIPE,stderr=subprocess.PIPE,shell=True)
g_info=g_info.read()
g_info=g_info.strip()
info=g_info.strip('||')
print g_info
print info
fp.close()
Error:
AttributeError: &
On Tue, Apr 17, 2018 at 4:11 PM, wrote:
> W dniu sobota, 27 stycznia 2018 16:59:50 UTC+1 użytkownik larry@gmail.com
> napisał:
>> I have a script that does this:
>>
>> subprocess.Popen(['service', 'some_service', 'status'],
>> stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
>>
>> When I ru
W dniu sobota, 27 stycznia 2018 16:59:50 UTC+1 użytkownik larry@gmail.com
napisał:
> I have a script that does this:
>
> subprocess.Popen(['service', 'some_service', 'status'],
> stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
>
> When I run it from the command line it works fine. When I r
On Sat, 27 Jan 2018 10:58:36 -0500, Larry Martell wrote:
> I have a script that does this:
>
> subprocess.Popen(['service', 'some_service', 'status'],
> stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
>
> When I run it from the command line it works fine. When I run it from
> cron I get:
>
>
On Sat, Jan 27, 2018 at 11:09 AM, Chris Angelico wrote:
> On Sun, Jan 28, 2018 at 2:58 AM, Larry Martell
> wrote:
>> I have a script that does this:
>>
>> subprocess.Popen(['service', 'some_service', 'status'],
>> stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
>>
>> When I run it from the com
If you have your script set $PATH and $HOME, you can test it with:
env - ./my-script
The difference between running a script from the command line, and
running a script from cron, is often environment variables. env -
clears the environment.
On Sat, Jan 27, 2018 at 7:58 AM, Larry Martell wrote:
On 2018-01-27, Larry Martell wrote:
> I have a script that does this:
>
> subprocess.Popen(['service', 'some_service', 'status'],
> stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
>
> When I run it from the command line it works fine. When I run it from
> cron I get:
>
> subprocess.Popen(['s
On Sun, Jan 28, 2018 at 2:58 AM, Larry Martell wrote:
> I have a script that does this:
>
> subprocess.Popen(['service', 'some_service', 'status'],
> stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
>
> When I run it from the command line it works fine. When I run it from
> cron I get:
>
> su
I have a script that does this:
subprocess.Popen(['service', 'some_service', 'status'],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
When I run it from the command line it works fine. When I run it from
cron I get:
subprocess.Popen(['service', 'some_service', 'status'],
stdout=subproces
5, in
>> os.environ.update(line.partition('=')[::2] for line in output.split
>> ('\0'))
>> AttributeError: 'Popen' object has no attribute 'split'
>> ---
>
> So your problem is nothing to do with “update ‘o
>
> Traceback (most recent call last):
> File "/home/werner/software/hpc/dft-to-study/jasp/jasp.git/jasp/bin/
> runjasp.py", line 125, in
> os.environ.update(line.partition('=')[::2] for line in output.split
> ('\0'))
> Att
Cecil Westerhof wrote:
> At the moment I am playing with things like:
> p = subprocess.Popen('ls -l', shell = True, stdout = subprocess.PIPE)
>
> I think that most of the times this are the values I want. So it would
> be nice to overrule the defaults. What is the best way to do this?
> So cr
Cecil Westerhof wrote:
> At the moment I am playing with things like:
> p = subprocess.Popen('ls -l', shell = True, stdout = subprocess.PIPE)
>
> I think that most of the times this are the values I want. So it would
> be nice to overrule the defaults. What is the best way to do this?
> So cr
Op Wednesday 20 May 2015 01:20 CEST schreef MRAB:
> On 2015-05-19 23:23, Cecil Westerhof wrote:
>> Op Tuesday 19 May 2015 23:28 CEST schreef Jon Ribbens:
>>
>>> On 2015-05-19, Cecil Westerhof wrote:
It looks like that this does what I want (the dot is needed so
that it also works with 2
On 2015-05-19 23:23, Cecil Westerhof wrote:
Op Tuesday 19 May 2015 23:28 CEST schreef Jon Ribbens:
On 2015-05-19, Cecil Westerhof wrote:
It looks like that this does what I want (the dot is needed so that
it also works with 2.7): files = sorted(os.listdir('.')) p =
re.compile('actions-2015-05
Op Tuesday 19 May 2015 23:28 CEST schreef Jon Ribbens:
> On 2015-05-19, Cecil Westerhof wrote:
>> It looks like that this does what I want (the dot is needed so that
>> it also works with 2.7): files = sorted(os.listdir('.')) p =
>> re.compile('actions-2015-05-[0-9][0-9].sql$') current_month = [
On 2015-05-19, Cecil Westerhof wrote:
> It looks like that this does what I want (the dot is needed so that it
> also works with 2.7):
> files = sorted(os.listdir('.'))
> p = re.compile('actions-2015-05-[0-9][0-9].sql$')
> current_month = [ file for file in files if p.match(file) ]
Yo
ing this anyway, rather than using os.listdir()?
>> Invoking subprocesses via the shell is very rarely a good idea.
>
> I want to rewrite a Bash script into a Python script. The 'ls -1' is
> only an example. But Popen and listdir give a different output. The
> sorting is
tdout (and maybe stderr).
>>
>> Yes.
>>
>> def shellprocess(cmd, **kwargs):
>> return subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
>> **kwargs)
>
> Will that not go wrong if I call it with?
> shellprocess('ls -1', shell = False)
Yes
rocess.getstatusoutput('ls -1')
>> files_new = output.splitlines() But it is still nice to know.
>
> Why are you doing this anyway, rather than using os.listdir()?
> Invoking subprocesses via the shell is very rarely a good idea.
I want to rewrite a Bash script into a Pytho
On Wed, May 20, 2015 at 3:55 AM, Zachary Ware
wrote:
>> def capture_stdout(*a, **kw):
>> if 'stdout' not in kw: kw['stdout'] = subprocess.PIPE
>
> Just a quick note that this line can be simplified nicely to:
>
> kw.setdefault('stdout', subprocess.PIPE)
Yes, in the simple case. That does requ
as
> the command, but if you make that the default, you'll end up exposing
> yourself in some situation where it isn't hard-coded.) With that
> change, there's really only one parameter that you're defaulting, so
> there's not as much point making the change, b
there's really only one parameter that you're defaulting, so
there's not as much point making the change, but the technique still
works, and maybe you'll add more to the setup:
@functools.wraps(subprocess.Popen)
def Popen(*a, **kw):
if 'stdout' not in kw: kw['
On 19.05.2015 19:01, Cecil Westerhof wrote:
> At the moment I am playing with things like:
> p = subprocess.Popen('ls -l', shell = True, stdout = subprocess.PIPE)
>
> I think that most of the times this are the values I want. So it would
> be nice to overrule the defaults. What is the best way
On 2015-05-19, Cecil Westerhof wrote:
> At the moment I am playing with things like:
> p = subprocess.Popen('ls -l', shell = True, stdout = subprocess.PIPE)
>
> I think that most of the times this are the values I want. So it would
> be nice to overrule the defaults. What is the best way to do
At the moment I am playing with things like:
p = subprocess.Popen('ls -l', shell = True, stdout = subprocess.PIPE)
I think that most of the times this are the values I want. So it would
be nice to overrule the defaults. What is the best way to do this? So
creating a function that is exactly th
satishmlm...@gmail.com wrote:
> What is Popen class?
Googling could answer that:
https://duckduckgo.com/html/?q=python+popen+class
If you have a specific question, please be more detailed when you ask your
question, then we can give more specific answers.
--
Steven
--
ht
On 31Oct2014 05:28, satishmlm...@gmail.com wrote:
What is Popen class?
It's a class from the subprocess module:
https://docs.python.org/3/library/subprocess.html#module-subprocess
used for starting external programs, waiting for them to execute, and using
their input and ou
What is Popen class?
--
https://mail.python.org/mailman/listinfo/python-list
ffer size! By
reducing the tail_buffer size , the script worked fine. I cant use
subprocess(Python Version is 2.4.3)
I do not want to rely on tail_buffer size. Ideally the script should be
independent of it!
Is there a way to flush data from the POPEN buffer ?
--
https://mail.python.org/mailman/listinfo/python-list
On 06/20/2013 06:20 AM, Jonathan Harden wrote:
Hi,
We have a class which executes external processes in a controlled environment and does
"things" specified by the client program with each line of output. To do this
we have been attaching stdout from the subprocess.Popen to a pseudo terminal (
On Thursday, 20 June 2013 11:20:20 UTC+1, Jonathan Harden wrote:
>
...SNIP
>
Sorry about the second post, it took a very long time to show up, long enough I
thought it had been lost.
--
http://mail.python.org/mailman/listinfo/python-list
On Thursday, 20 June 2013 23:04:39 UTC+1, Peter Otten wrote:
> (2) Fiddle with terminal options, e. g.
>
> attrs = termios.tcgetattr(outSlave)
> attrs[1] = attrs[1] & (~termios.ONLCR) | termios.ONLRET
> termios.tcsetattr(outSlave, termios.TCSANOW, attrs)
>
> p = subprocess.Pop
pened with os.fdopen. I noticed
that we kept getting a bunch of extra new line characters.
This is all using python 2.6.4 in a centos6 environment.
After some investigation I realised we needed to use universal_newline support
so I enabled it for the Popen and specified the mode in the fdope
gt; line characters.
Mixing subprocess and explicit select() looks a bit odd to me. Perhaps you
should do it completely without subprocess. Did you consider pexpect?
> This is all using python 2.6.4 in a centos6 environment.
>
> After some investigation I realised we needed to use universal
After some investigation I realised we needed to use universal_newline support
so I enabled it for the Popen and specified the mode in the fdopen to be rU.
Things still seemed to be coming out wrong so I wrote up a test program boiling
it down to the simplest cases (which is at the end of this mes
On Wed, 19 Jun 2013 23:03:05 +, Joseph L. Casale wrote:
> I am trying to invoke a binary that requires dll's in two places all of
> which are included in the path env variable in windows. When running this
> binary with popen it can not find either, passing env=os.environ to
I am trying to invoke a binary that requires dll's in two places all of
which are included in the path env variable in windows. When running
this binary with popen it can not find either, passing env=os.environ
to open made no difference.
Anyone know what might cause this or how to work a
On Tue, 11 Jun 2013 01:50:07 +, Joseph L. Casale wrote:
> I am using Popen to run the exe with communicate() and I have sent stdout
> to PIPE without luck. Just not sure what is the proper way to iterate over
> the stdout as it eventually makes its way from the buffer.
The prop
one of those days, the post was rather
> > useless...
> >
> > I am using Popen to run the exe with communicate() and I have sent
> > stdout to PIPE without luck. Just not sure what is the proper way to
> > iterate over the stdout as it eventually makes its way fr
"Joseph L. Casale" writes:
>> You leave out an awful amount of detail. I have no idea what ST is,
>> so I'll have to guess your real problem.
>
> Ugh, sorry guys its been one of those days, the post was rather
> useless...
>
> I am using Popen to run
> You leave out an awful amount of detail. I have no idea what ST is, so
> I'll have to guess your real problem.
Ugh, sorry guys its been one of those days, the post was rather useless...
I am using Popen to run the exe with communicate() and I have sent stdout to
PIPE
without luc
On 06/10/2013 02:37 PM, Joseph L. Casale wrote:
I have a use where writing an interim file is not convenient and I was hoping to
iterate through maybe 100k lines of output by a process as its generated or
roughly anyways.
Seems to be a common question on ST, and more easily solved in Linux.
Anyo
On 2013-06-10, Joseph L. Casale wrote:
> I have a use where writing an interim file is not convenient and I
> was hoping to iterate through maybe 100k lines of output by a process
> as its generated or roughly anyways.
>
> Seems to be a common question on ST, and more easily solved in Linux.
> An
I have a use where writing an interim file is not convenient and I was hoping to
iterate through maybe 100k lines of output by a process as its generated or
roughly anyways.
Seems to be a common question on ST, and more easily solved in Linux.
Anyone currently doing this with Python 2.7 in windows
On Tuesday, May 22, 2012 2:45:11 AM UTC+2, alex23 wrote:
> On May 22, 3:00 am, xliiv wrote:
> > Now I know that my 'solution' is not a solution and problem still bugs me.
> > Any ideas how to deal with it?
>
> I haven't tried it but this thread talks about being able to use a
> standard install o
On May 22, 3:00 am, xliiv wrote:
> Now I know that my 'solution' is not a solution and problem still bugs me.
> Any ideas how to deal with it?
I haven't tried it but this thread talks about being able to use a
standard install of Python with OpenOffice:
http://user.services.openoffice.org/en/for
.py file is
> executing. Unless you're able to make the file a .pyw file - which you
> are apparently not as you're using OpenOffice - then executing the
> code that uses Popen is what is displaying a console, not the call to
> Popen itself.
Ok, thanks for explanation.
Now I
not as you're using OpenOffice - then executing the
code that uses Popen is what is displaying a console, not the call to
Popen itself.
--
http://mail.python.org/mailman/listinfo/python-list
On 5/18/12 4:22 AM, xliiv wrote:
Like the topic, more details in followed links..
http://stackoverflow.com/questions/10637450/how-to-hide-console-with-popen-on-windows
http://code.activestate.com/recipes/409002-launching-a-subprocess-without-a-console-window/?c=14452
Please help :(
Any hint
On Fri, May 18, 2012 at 6:22 PM, xliiv wrote:
> Like the topic, more details in followed links..
>
>
> http://stackoverflow.com/questions/10637450/how-to-hide-console-with-popen-on-windows
As you've already been advised, the way to avoid a console is to use
pythonw.exe (wh
code below -
but I get the same results (inconsistent termination, logs still match
up as though everything worked fine. If I'm not in DAEMONIZE mode and
hold down enter, I can get stdout from the Popen process too - which I
have seen with and without the DaemonContext package. There seems to be
On 18Mar2012 12:35, John O'Hagan wrote:
| On Sat, 17 Mar 2012 18:17:10 -0400
| Lee Clemens wrote:
| > Is it generally not recommended to daemonize Python applications using
| > this method?
|
| I'm no guru, but not that I know of. I haven't seen the os.fork method you use
| before; out of inter
On Sat, 17 Mar 2012 18:17:10 -0400
Lee Clemens wrote:
> On 03/16/2012 11:37 PM, John O'Hagan wrote:
> > On Fri, 16 Mar 2012 22:12:14 -0400
> > Lee Clemens wrote:
> >
> >> I have a multi-threaded application
> >>
> >> I have provided a test-case here: https://gist.github.com/2054194
> > I haven't
On 03/16/2012 11:37 PM, John O'Hagan wrote:
> On Fri, 16 Mar 2012 22:12:14 -0400
> Lee Clemens wrote:
>
>> I have a multi-threaded application
>>
>> I have provided a test-case here: https://gist.github.com/2054194
> I haven't looked at your test case yet, but a possible cause is the fact that
> t
On Fri, 16 Mar 2012 22:12:14 -0400
Lee Clemens wrote:
>
> I have a multi-threaded application, each thread has an instance of a class
> which calls Popen. The command(s) being executed (shell=True) include pipes.
> The errors I have seen involve "broken pipe" and
class
which calls Popen. The command(s) being executed (shell=True) include pipes.
The errors I have seen involve "broken pipe" and unexepected output (as
demonstrated in the test case).
This issues only seem to occur when the application is "daemonized", using a
double-
Hi!
I have a problem with SSL and threaded os.system (rewritten to Popen but
still not working). First - the set-up:
I am using windows 2003 server with current python 2.6.
When new connection comes to my server-side application, i do accept,
and then:
self.client =
ssl.wrap_socket
Am 28.01.2012 11:19 schrieb pistacchio:
the following code (in the main thread) works well, I grep some files
and the search until the first 100 results are found (writing the
results to a file), then exit:
command = 'grep -F "%s" %s*.txt' % (search_string, DATA_P
the following code (in the main thread) works well, I grep some files
and the search until the first 100 results are found (writing the
results to a file), then exit:
command = 'grep -F "%s" %s*.txt' % (search_string, DATA_PATH)
p = Popen(['/bin/bash',
Am 04.08.2011 10:42 schrieb Chris Rebert:
I was considering the more general case where one of the strings may
have come from user input. You then need to also escape
$looks_like_a_var, `some_command`, and way more other such stuff that
your simple function doesn't cover.
Even these things are
On Thu, Aug 4, 2011 at 1:10 AM, Thomas Rachel
wrote:
> Am 03.08.2011 19:27 schrieb Chris Rebert:
>
>>> shell= True,
>>
>> I would strongly encourage you to avoid shell=True.
>
> ACK, but not because it is hard, but because it is unnecessary and unelegant
> at this point.
>
>> Y
Am 03.08.2011 17:29 schrieb Phlip:
Groupies:
This is either a code snippet, if you like it, or a request for a
critique, if you don't.
Well, at first, I cannot see the real point about it...
def command(*cmdz):
process = Popen( flatten(cmdz),
shell=
Am 03.08.2011 19:27 schrieb Chris Rebert:
shell= True,
I would strongly encourage you to avoid shell=True.
ACK, but not because it is hard, but because it is unnecessary and
unelegant at this point.
You really don't want to have to worry about doing proper shell esca
On 8/3/2011 11:29 AM, Phlip wrote:
This is either a code snippet, if you like it, or a request for a
critique, if you don't.
A learning exercise but pretty useless otherwise. As others pointed out,
immediately stripping off \n is a bug relative to *your* function
description. Also, you yours
> flatten() being defined as...?
Python Cookbook recipe 4.6
def flatten(sequence): # CONSIDER: Reconcile with utils...
for item in sequence:
if isinstance(item, (list, tuple)):
for subitem in flatten(list(item)):
yield subitem
else:
y
s application-specifically
> as possible. Anyone could think of a way to productize this:
>
> def command(*cmdz):
>
> process = Popen( flatten(cmdz),
flatten() being defined as...?
> shell= True,
I would strongly encourage you to avoid shell=True. You re
lication-specifically
> as possible. Anyone could think of a way to productize this:
>
> def command(*cmdz):
>
> process = Popen( flatten(cmdz),
> shell= True,
> stdout= subprocess.PIPE,
> stderr= subprocess.PIPE,
&
s an object. And I want to do it as application-specifically
> as possible. Anyone could think of a way to productize this:
>
> def command(*cmdz):
>
> process = Popen( flatten(cmdz),
> shell= True,
> stdout= subprocess.PIPE,
&g
Chris Torek wrote:
> Since it is a generator that only requests another line when called,
> it should be fine
Is it, then, that until the new itaration, the callee is on pause?
--
goto /dev/null
--
http://mail.python.org/mailman/listinfo/python-list
terminating -- in this case, after you force it
to do so.
>That looks good enough. I noted some little delay for the first lines,
>mostly sure Popen assign some buffer even it is not set.
According to the documentation, the default buffer size of Python 2
is 0, which is passed to fdopen()
Chris Torek wrote:
> In at least some versions of Python 2
I'm with P3k :P. However thank you for your guidelines.
Last my attempt was to use a *for* p.wait() , as mentioned earlier
That looks good enough. I noted some little delay for the first lines,
mostly sure Popen assign some buf
In article
TheSaint wrote:
>Chris Rebert wrote:
>I just suppose to elaborate the latest line, as soon it's written on the
>pipe, and print some result on the screen.
>Imaging something like
>
> p= Popen(['ping','-c40','www.google.com'], stdo
TheSaint wrote:
> I just suppose to elaborate the latest line, as soon it's written on the
> pipe, and print some result on the screen.
I think some info is also here:
http://alexandredeverteuil.blogspot.com/
--
goto /dev/null
--
http://mail.python.org/mailman/listinfo/python-list
Chris Rebert wrote:
> What do you mean by "on-the-fly" in this context
I just suppose to elaborate the latest line, as soon it's written on the
pipe, and print some result on the screen.
Imaging something like
p= Popen(['ping','-c40','www.googl
On Sun, May 29, 2011 at 3:02 AM, TheSaint wrote:
> Tim Roberts wrote:
>
>> Are you specifying a buffer size in the Popen command? If not, then the
>> Python side of things is unbuffered
>
> The buffer is as per default. The program reports one line around 1/2 second
>
Tim Roberts wrote:
> Are you specifying a buffer size in the Popen command? If not, then the
> Python side of things is unbuffered
The buffer is as per default. The program reports one line around 1/2 second
time.
I think I'll look into the option as Nobody states:
ry line that prgram may blow
> >during the process, but the output is given only when the child process is
> >ended.
> >I'd like to process the lines to display an information in percentage
> during
> >the running time of the child.
>
> Are you specifying a b
y when the child process is
>ended.
>I'd like to process the lines to display an information in percentage during
>the running time of the child.
Are you specifying a buffer size in the Popen command? If not, then the
Python side of things is unbuffered. It's possible that the
On Sun, 29 May 2011 00:01:56 +0800, TheSaint wrote:
> I'm looking into subprocess.Popen docs. I've launch the program with its
> arguments and that's smooth. I'm expecting to read the output by
> *comunicate()* at every line that prgram may blow during the process, but
> the output is given only w
Hello.
I'm looking into subprocess.Popen docs.
I've launch the program with its arguments and that's smooth. I'm expecting
to read the output by *comunicate()* at every line that prgram may blow
during the process, but the output is given only when the child process is
ended.
I'd like to process
> Read The Fine
> Manual:http://docs.python.org/library/subprocess.html#subprocess.Popen:
snip...
>
> Try instead:
> cmd3 = ['ffmpeg', '-i', '/home/giga/Desktop/Guitar1.flv']
>
> Cheers,
> Chris
> --http://blog.rebertia.com
No doubt, I should RTFM...you're right!
Yes, works like a charm now.
On Tue, 19 Apr 2011 00:07:46 +0100, goldtech
wrote:
Trying to learn how to run a linux command and get the stdout and
stderr. I'm trying the following:
cmd3 = r'ffmpeg -i /home/giga/Desktop/Guitar1.flv'
p = Popen(cmd3, stdout=PIPE, stderr=PIPE)
Traceback (most recent cal
On Mon, Apr 18, 2011 at 4:07 PM, goldtech wrote:
> Hi,
>
> Trying to learn how to run a linux command and get the stdout and
> stderr. I'm trying the following:
>
>>>> cmd3 = r'ffmpeg -i /home/giga/Desktop/Guitar1.flv'
>>>> p = Popen(cmd3, std
Hi,
Trying to learn how to run a linux command and get the stdout and
stderr. I'm trying the following:
>>> cmd3 = r'ffmpeg -i /home/giga/Desktop/Guitar1.flv'
>>> p = Popen(cmd3, stdout=PIPE, stderr=PIPE)
Traceback (most recent call last):
File "",
On Sat, Apr 9, 2011 at 5:28 AM, Nobody wrote:
> There isn't a robust solution to the OP's problem. It's typically
> impossible to determine whether one process is an ancestor of another if
> any of the intermediate processes have terminated.
Upstart and gdb can both detect forks and follow the ch
On Fri, 08 Apr 2011 07:43:41 -0700, Miki Tebeka wrote:
>> p = subprocess.Popen(shlex.split("kdesu -u test program"))
>>
>> How can I aquire the PID of the program which kdesu starts?
>
> You can run "ps --ppid " and get the line containing test program.
> The first field there should be the
1 - 100 of 430 matches
Mail list logo