Re: popen2 results

2007-04-25 Thread Steven Howe
Robert Rawlins - Think Blue wrote: Hello guys, I've recently ported my application from bash to python, however there are still a few bash line utilities I -have- to use in the application as there isn't any alternative available to me. In the old days of bash I would have grep'd the output

Re: popen2 question

2006-06-25 Thread Lawrence D'Oliveiro
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 simple. > >(input, output) = os.popen2('whackyperlprog

Re: popen2

2005-10-30 Thread Piet van Oostrum
> 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

Re: popen2

2005-10-30 Thread Piet van Oostrum
> 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

Re: popen2

2005-10-29 Thread Grant Edwards
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

Re: popen2

2005-10-29 Thread Piet van Oostrum
> 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 popen2.popen3('myprogram') and myprogram.exe is >gf> running before, I've a connection to

Re: popen2

2005-10-29 Thread Donn Cave
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.popen3('myprogram') and myprogram.exe is |>>>gf> running before, I've

Re: popen2

2005-10-29 Thread Pierre Hanser
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.exe is >>>gf> running before, I've a connection to the second process, not to t

Re: popen2

2005-10-29 Thread Grant Edwards
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've a connection to the second process, not to the >>first. >>gf> I can find th

Re: popen2

2005-10-29 Thread Piet van Oostrum
> "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 the process by name before I start a process with popen2..., >gf> but

Re: popen2

2005-10-28 Thread g.franzkowiak
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 ? >> >>gerd > > > It's not clear what you're asking for.

Re: popen2

2005-10-28 Thread David Wahler
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're asking for. Could you please clarify? -- David

Re: popen2 usage

2005-07-21 Thread jb
Actually, "-test1" is a text argument that testme.exe should receive from standard input. For example, Executing testme.exe generates the following output, Please select one of the following options: 1) test1 2) test2 3) exit Please enter your option here:-test1 <-This -test1 is what user would typ

Re: popen2 usage

2005-07-19 Thread Steven Bethard
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 input pipe so that executable

Re: popen2 psql

2005-05-03 Thread Mage
Klaus Alexander Seistrup wrote: >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? > > > Thank you

Re: popen2 psql

2005-05-02 Thread Klaus Alexander Seistrup
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

Re: popen2.Popen3 doesn't work well for me

2005-03-09 Thread Steven Bethard
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

Re: popen2.Popen3 doesn't work well for me

2005-03-09 Thread alexrait1
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

Re: popen2.Popen3 doesn't work well for me

2005-03-09 Thread Steve Holden
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 is blocking on

Re: popen2, 3, 4 -- will closing all returned streams result in process termination?

2004-12-28 Thread Jean Brouwers
It depends mostly on how the spawned process handles conditions like closed pipes, EOF, etc. In general and on *nix, any spawned and terminated process will become and remain a zombie until "reaped", i.e. until the final status is collected by a calling os.waitpid(). To avoid zombies, you should

Re: popen2, 3, 4 -- will closing all returned streams result in process termination?

2004-12-28 Thread Paul Rubin
[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