In article <2542cf60-a193-4087-a1fe-1d60ee13c...@v25g2000yqk.googlegroups.com>,
lofic wrote:
>On 7 f=E9v, 17:00, a...@pythoncraft.com (Aahz) wrote:
>> In article <188bfb67-3334-4325-adfc-3fa4d28f0...@d27g2000yqn.googlegroups=
>.com>,
>> lofic =A0 wrote:
>>>
>>>Works fine on RHEL5/python 2.4.3
>>>
On 7 fév, 17:00, a...@pythoncraft.com (Aahz) wrote:
> In article
> <188bfb67-3334-4325-adfc-3fa4d28f0...@d27g2000yqn.googlegroups.com>,
>
> lofic wrote:
>
> >Works fine on RHEL5/python 2.4.3
> >Hangs on RHEL4/python 2.3.4
>
> Then use Python 2.4 -- surely you don't expect anyone to provide bugfi
In article <188bfb67-3334-4325-adfc-3fa4d28f0...@d27g2000yqn.googlegroups.com>,
lofic wrote:
>
>Works fine on RHEL5/python 2.4.3
>Hangs on RHEL4/python 2.3.4
Then use Python 2.4 -- surely you don't expect anyone to provide bugfixes
for a release that's several years old?
--
Aahz (a...@pythoncra
Hello,
I've seen many messages and bug reports on popen2 about pipes, buffer
size problems, sub-processes not properly closed, race conditions,
popen2 not being thread safe... But I still can't figure what applies
to my case.
This piece of code:
#!/usr/bin/python
import threading
imp
On 20 ago, 17:26, Tobiah <[EMAIL PROTECTED]> wrote:
> In the popen docs, a file like object is returned,
> and may be read to or written to depending on the
> 'mode' parameter ('r', or 'w').
>
> Why is the mode parameter needed for popen2 an
In the popen docs, a file like object is returned,
and may be read to or written to depending on the
'mode' parameter ('r', or 'w').
Why is the mode parameter needed for popen2 and greater,
when both a stdin and stdout object is returned? One
wouldn't wan
27;d the output from these commands to determine the outcome.
I'm now using popen2 to run the command which works a charm, but I'm
struggling to parse the results of the function, has anyone had any
experience with this? I've found a few suggested solutions dotted around,
such as
o determine the outcome.
I'm now using popen2 to run the command which works a charm, but I'm
struggling to parse the results of the function, has anyone had any
experience with this? I've found a few suggested solutions dotted around,
such as this one.
import os
flupke schreef:
Thanks for all the info.
I'm sure i will get it right this time :)
Benedict
--
http://mail.python.org/mailman/listinfo/python-list
t; Problem is that it prompts for a password. It thought i
> > > could solve this by using popen2.
> >
> > Use pexpect:http://pexpect.sourceforge.net/
>
> pexpect could work. But a better way would be to supply the password
> on the command line. I don't know how pos
in Mettler <[EMAIL PROTECTED]> wrote:
>> >> flupke schrieb:
>> >> > i made a backup script to backup my postgres database.
>> >> > Problem is that it prompts for a password. It thought i
>> >> > could solve this by using popen2.
>>
>> &g
e a backup script to backup my postgres database.
> >> > Problem is that it prompts for a password. It thought i
> >> > could solve this by using popen2.
>
> >> Use pexpect:http://pexpect.sourceforge.net/
>
> >pexpect could work. But a better way would be to su
ts for a password. It thought i
>> > could solve this by using popen2.
>>
>> Use pexpect:http://pexpect.sourceforge.net/
>
>pexpect could work. But a better way would be to supply the password
>on the command line.
So that it shows up in `ps' output to anyone on the system? :)
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
On 8 feb, 10:27, Maël Benjamin Mettler <[EMAIL PROTECTED]> wrote:
> flupke schrieb:
> > i made a backup script to backup my postgres database.
> > Problem is that it prompts for a password. It thought i
> > could solve this by using popen2.
>
> Use pexpect:http://
Use pexpect: http://pexpect.sourceforge.net/
flupke schrieb:
> Hi,
>
> i made a backup script to backup my postgres database.
> Problem is that it prompts for a password. It thought i
> could solve this by using popen2.
> I tested popen2 with dir (i'm on windows 2000,
Hi,
i made a backup script to backup my postgres database.
Problem is that it prompts for a password. It thought i
could solve this by using popen2.
I tested popen2 with dir (i'm on windows 2000, python 2.4.3)
and it works.
However when i try popen2 and my pg_dump command, it prompts
Thanks /F, that was it.
Dan
On Sat, 18 Nov 2006 15:03:30 +0100, Fredrik Lundh
<[EMAIL PROTECTED]> wrote:
[snip]
>p.stdin is the *other* process' stdin. if you want to read things it
>prints, read from p.stdout instead.
>
>> print fin.readline()
>> fin.close()
>
>
--
http://mail.python.org/m
Daniel Klein wrote:
> Now here is my attempt to use the 'subprocess' module :
>
> from subprocess import *
> p = Popen(r'c:\home\hw.exe', bufsize=-1, stdin=PIPE, stdout=PIPE,
> universal_newlines=True)
> fin = p.stdin
p.stdin is the *other* process' stdin. if you want to read things it
prints,
Daniel Klein wrote:
> Here's a c routine that prints a single line :
>
> #include
> main()
> {
> printf ("Hello World!\n");
> }
>
> And now the Python program (called 'po.py') that uses 'popen2' :
>
> import popen2
> (fin,
Here's a c routine that prints a single line :
#include
main()
{
printf ("Hello World!\n");
}
And now the Python program (called 'po.py') that uses 'popen2' :
import popen2
(fin, fout) = popen2.popen2(r'c:\home\hw.exe', -1, 't')
print fi
Daniel Klein wrote:
>I have a few Python programs that use popen2, and they work quite
> nicely and dependably, so I don't really have any reason to change
> them to use the new subprocess module...unless of course there any
> future plans to deprecate popen2.
definitely not
I have a few Python programs that use popen2, and they work quite
nicely and dependably, so I don't really have any reason to change
them to use the new subprocess module...unless of course there any
future plans to deprecate popen2.
Is this something I will have to plan for ?
--
In article <[EMAIL PROTECTED]>,
David Bear <[EMAIL PROTECTED]> wrote:
>I'm using popen2 and getting an extra 1 at the end of my output. I didn't
>see where this was explained in the docs so I clearly don't understand the
>behavior. My code is si
I'm using popen2 and getting an extra 1 at the end of my output. I didn't
see where this was explained in the docs so I clearly don't understand the
behavior. My code is simple.
(input, output) = os.popen2('whackyperlprogram')
results = output.read()
rc = output.c
That's just it. I was hoping to have python listening for events and
responding continually according to the demaons stdout. That's why I
mention popen2.
--
http://mail.python.org/mailman/listinfo/python-list
every few seconds
>or can this be done a better way. I'm hoping for a more elegant
>solution. So far I've seen some troubling info about buffer overflows
>with popen2 but it looks like the low-hanging fruit. I'm not a unixpro
>so I want to make sure anything I tackle is b
I'm hoping for a more elegant
> solution. So far I've seen some troubling info about buffer overflows
> with popen2 but it looks like the low-hanging fruit. I'm not a unixpro
> so I want to make sure anything I tackle is best practice. Suggestions
> welcomed.
>
> -Ar
o far I've seen some troubling info about buffer overflows
with popen2 but it looks like the low-hanging fruit. I'm not a unixpro
so I want to make sure anything I tackle is best practice. Suggestions
welcomed.
-Aris
--
http://mail.python.org/mailman/listinfo/python-list
Dennis Lee Bieber wrote:
> On Tue, 28 Mar 2006 18:02:46 GMT, "I. Myself" <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
>
>> The compile C program, commer.exe, writes a line of text to its stdout.
>> The python program does not receive it; it never gets to print "Got here
Rene Pijlman wrote:
> I. Myself:
>
>> I can't get this to work
>>
>
> With what versions of what software on what platform?
>
I'm glad you asked. really!
Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32
Windows 2000. AMD processor. mingw compiler.
Mitche
I. Myself:
>I can't get this to work
With what versions of what software on what platform?
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
I can't get this to work:
# commer.py - to test communication with other process
from popen2 import popen2
(child_stdout, child_stdin) = popen2("commer.exe")
print "Got here 1"
line = child_stdout.readline()
print "Got here 2"
child_stdin.write(line)
child_
Sion Arrowsmith wrote:
> Kent Johnson <[EMAIL PROTECTED]> wrote:
>
>>Sion Arrowsmith wrote:
>>
>>>(and please avoid the abuse of raw strings for Windows paths).
>>
>>Why do you consider that abuse of raw strings?
>
> I consider it abuse because it's not what they were invented for.
> I consider
Kent Johnson <[EMAIL PROTECTED]> wrote:
>Sion Arrowsmith wrote:
>> (and please avoid the abuse of raw strings for Windows paths).
>Why do you consider that abuse of raw strings?
I consider it abuse because it's not what they were invented for.
I consider discouraging it to be a good thing in orde
Sion Arrowsmith wrote:
> Try:
> std_out, std_in = popen2.popen2("F:/coding/pwSync/popen_test/testia.py")
> or:
> std_out, std_in = popen2.popen2("F:\\coding\\pwSync\\popen_test\\testia.py")
> (and please avoid the abuse of raw strings for Windows paths).
Wh
Sion Arrowsmith wrote:
"F:\coding\pwSync\popen_test\testia.py"
> 'F:\\coding\\pwSync\\popen_test\testia.py'
this might make it more obvious that something's not quite right with that
string literal:
>>> print "F:\coding\pwSync\popen_test\testia.py"
F:\coding\pwSync\popen_test es
Martin P. Hellwig <[EMAIL PROTECTED]> wrote:
>std_out, std_in = popen2.popen2("F:\coding\pwSync\popen_test\testia.py")
^^
Your problem is, I suspect, nothing to do with popen2(), which is
supported by the fact that t
with, but I'm still
curious how to get this working on NT.
I posted my new code and the results under my sep.
--
mph
popen_test.py----
#! /usr/local/bin/python
import popen2
std_out, std_in = popen2.popen2("F:\coding\pwSync\popen_test\testia.py")
s
gry@ll.mit.edu wrote:
>
> You gave it a single string, not a list(sequence) of strings. Try
> something like:
> std_in.writelines(["notgood"])
>
I got this output then:
>>>
something:
Traceback (most recent call last):
File "F:\coding\pwSync\popen_test\popen_test.py", line 8, in ?
Quoth gry@ll.mit.edu:
| Martin P. Hellwig wrote:
...
|> import popen2
|>
|> std_out, std_in = popen2.popen2("testia.py")
|>
|> x=std_out.readline()
|> print(x)
|>
|> std_in.writelines("notgood")
|>
|> x=std_out.readline()
|> print(x)
...
|>
Martin P. Hellwig wrote:
> Hi all,
>
> I was doing some popen2 tests so that I'm more comfortable using it.
> I wrote a little python script to help me test that (testia.py):
>
> -
> someline = raw_input("something:")
>
>
Hi all,
I was doing some popen2 tests so that I'm more comfortable using it.
I wrote a little python script to help me test that (testia.py):
-
someline = raw_input("something:")
if someline == 'test':
print(&quo
I want to catch the output of a program but I can not use redirect
because it's interactive and thus I need to see the output on the
screen.
So I use popen2() to execute it and then both print the output on the screen and in a log file.
But when I want to write something command to it, it
> Piet van Oostrum <[EMAIL PROTECTED]> (PvO) wrote:
>PvO> He didn't state that he has no control over that program. I.e. if it is a
>PvO> program that he has source code of, he could change its behaviour to use a
>PvO> named pipe.
He could do the initial run of the program with stdin and stdo
> Grant Edwards <[EMAIL PROTECTED]> (GE) wrote:
>GE> On 2005-10-29, Piet van Oostrum <[EMAIL PROTECTED]> wrote:
>GE> That would require that the application know about the named
>GE> pipe and open it. I don't think there is any way to swap a
>GE> pipe in for stdin/stdout once a process is run
On 2005-10-29, Piet van Oostrum <[EMAIL PROTECTED]> wrote:
>>GE> That would require that the application know about the named
>>GE> pipe and open it. I don't think there is any way to swap a
>>GE> pipe in for stdin/stdout once a process is running.
>
> Sure. 'myprogram' should be designed to comm
>>>>> Grant Edwards <[EMAIL PROTECTED]> (GE) wrote:
>GE> On 2005-10-29, Piet van Oostrum <[EMAIL PROTECTED]> wrote:
>>>>>>>> "g.franzkowiak" <[EMAIL PROTECTED]> (gf) wrote:
>>>
>gf> If starts a process with p
Quoth Pierre Hanser <[EMAIL PROTECTED]>:
| Grant Edwards a écrit :
|> On 2005-10-29, Piet van Oostrum <[EMAIL PROTECTED]> wrote:
|>>>>>>>"g.franzkowiak" <[EMAIL PROTECTED]> (gf) wrote:
|>>
|>>>gf> If starts a process with popen2
Grant Edwards a écrit :
> On 2005-10-29, Piet van Oostrum <[EMAIL PROTECTED]> wrote:
>
>>>>>>>"g.franzkowiak" <[EMAIL PROTECTED]> (gf) wrote:
>>
>>>gf> If starts a process with popen2.popen3('myprogram') and myprogram.e
On 2005-10-29, Piet van Oostrum <[EMAIL PROTECTED]> wrote:
>>>>>> "g.franzkowiak" <[EMAIL PROTECTED]> (gf) wrote:
>
>>gf> If starts a process with popen2.popen3('myprogram') and myprogram.exe is
>>gf> running before, I'
>>>>> "g.franzkowiak" <[EMAIL PROTECTED]> (gf) wrote:
>gf> If starts a process with popen2.popen3('myprogram') and myprogram.exe is
>gf> running before, I've a connection to the second process, not to the first.
>gf> I can find
David Wahler schrieb:
> g.franzkowiak wrote:
>
>>I start a process in my application with popen2.popen3('MyOtherProcess').
>>That's ok, but what can I do if the other process is running ?
>>Can I fetch some information and start with that ?
>>
>>
g.franzkowiak wrote:
> I start a process in my application with popen2.popen3('MyOtherProcess').
> That's ok, but what can I do if the other process is running ?
> Can I fetch some information and start with that ?
>
> gerd
It's not clear what you'
I start a process in my application with popen2.popen3('MyOtherProcess').
That's ok, but what can I do if the other process is running ?
Can I fetch some information and start with that ?
gerd
--
http://mail.python.org/mailman/listinfo/python-list
Magnus Lycka wrote:
> I'm trying to read standard out in a process started with popen2
> in a non-blocking way. (Other good ways of doing this than the
> one I tried are appreciated.)
I'm starting to get on top of this. First of all, I was confused
by POLLIN and POLLOUT, sinc
I'm trying to read standard out in a process started with popen2
in a non-blocking way. (Other good ways of doing this than the
one I tried are appreciated.)
I've tried to dumb down my code to see what happens, and
socket.poll seems to behave very strangely. I've tried to
use the .
Is there any good tutorial/example about popen2 and popen3? I have to
execute a given command on Linux and Windows from within a Python program.
If possible, on Linux I would like to be able to set the executing user
(setuid) and the niceness level of the command. (and yes: I know it is a
at user would
type
Thanks,
-JB
Steven Bethard wrote:
> jb wrote:
> > Hi there:
> >
> > I need help with popen2 usage. I am coding on Windows 2000 environment
> > and I am basically trying to run command line executable program that
> > accepts command line arg
jb wrote:
> Hi there:
>
> I need help with popen2 usage. I am coding on Windows 2000 environment
> and I am basically trying to run command line executable program that
> accepts command line arguments from user. I want to be able to provide
> these arguments through
Hi there:
I need help with popen2 usage. I am coding on Windows 2000 environment
and I am basically trying to run command line executable program that
accepts command line arguments from user. I want to be able to provide
these arguments through input pipe so that executable does not require
any
you look
>in the ~/.psql_history file?
>
>
>
Thank you. I will check but what about the python scripts? Why can't I
read their *print* output with popen2?
Mage
--
http://mail.python.org/mailman/listinfo/python-list
Mage wrote:
> I tried to write a proxy script for "psql" command. I need some
> query log. I failed to read from the file object.
The psql command is probably linked against readline; did you look
in the ~/.psql_history file?
Cheers,
--
Klaus Alexander Seistrup
Magnetic Ink, Copenhagen, Denmar
pen2('./pto.py')
for s in b.readlines(): print s,
popen2 works with 'ls' but it doesn't output anything with the './pto.py'.
The 'pto.py' is an existing python script and contains some print.
Likely I have the same problem with popening the python scri
alexrait1 wrote:
It does but that's not what I want. I need a class which I can query
for process termination for instance...
Is there a way to overcome this problem with Popen3?
If you're using Python 2.4 you should look into the subprocess module.
I think these docs might be what you're looking
It does but that's not what I want. I need a class which I can query
for process termination for instance...
Is there a way to overcome this problem with Popen3?
--
http://mail.python.org/mailman/listinfo/python-list
alexrait1 wrote:
I launch my python. Then I write this:
import popen2
popen2.Popen3("mplayer *.mpg")
it starts playing for 2 seconds.. and then stops...
if I quit python (ctrl - D)
mplayer continues to run and plays music as it should...
Any ideas?
It looks like the process you start i
I launch my python. Then I write this:
import popen2
popen2.Popen3("mplayer *.mpg")
it starts playing for 2 seconds.. and then stops...
if I quit python (ctrl - D)
mplayer continues to run and plays music as it should...
Any ideas?
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 01 Feb 2005 17:48:53 -0800, lists04 wrote:
> Hi,
>
> I have a problem with a curl request and running it under popen2.
>
> If I run this request from the command line:
> curl -i http://www.yahoo.com/test --stderr errfile
> (also tried redirecting stdderr to a file
Hi,
I have a problem with a curl request and running it under popen2.
If I run this request from the command line:
curl -i http://www.yahoo.com/test --stderr errfile
(also tried redirecting stdderr to a file 2>, nothing) the file errfile
is empty indicating no error with the request.
Howe
mbies, you should call the poll() or wait() method of the
Popen3 object created for each spawned process or call os.waitpid().
The problem is that the popen* functions only return the pipe objects
and not the Popen3 instance nor the process id.
Take a look at the source code of the popen2 module wh
[EMAIL PROTECTED] (Evgeni Sergeev) writes:
> Is there assurance that the process will terminate and not sit
> in memory orphaned, waiting on its stdin, for example?
The process should receive an EOF. It will typically handle EOF by
terminating, but that is not guaranteed.
--
http://mail.python.o
After I opened streams to a process using popen2, popen3 or popen4,
will closing every one of the streams terminate the process?
Is there assurance that the process will terminate and not sit
in memory orphaned, waiting on its stdin, for example?
Evgeni Sergeev
--
http://mail.python.org
72 matches
Mail list logo