Re: popen4 - get exit status

2012-08-28 Thread Tim Johnson
* Dennis Lee Bieber [120828 07:11]: > On Mon, 27 Aug 2012 15:43:59 -0800, Tim Johnson > declaimed the following in gmane.comp.python.general: > > > * Benjamin Kaplan [120827 15:20]: > > > The popen* functions are deprecated. You should use the subprocess module > > > instead. > > No, I'm stuc

Re: popen4 - get exit status

2012-08-27 Thread Tim Johnson
ring if > > there is a better way. From help(os) - I don't find any variables dedicated > > to > > holding exit status. > > According to: > http://docs.python.org/library/popen2.html > <http://docs.python.org/library/popen2.html> > > " The onl

Re: popen4 - get exit status

2012-08-27 Thread Tim Johnson
* Benjamin Kaplan [120827 15:20]: > The popen* functions are deprecated. You should use the subprocess module > instead. No, I'm stuck with py 2.4 on one of the servers I'm using and there will not be an upgrade for a few months. I'm really trying to set up something portable between linux->

Re: popen4 - get exit status

2012-08-27 Thread Benjamin Kaplan
On Aug 27, 2012 3:47 PM, "Tim Johnson" wrote: > > In bash I do the following: > linus:journal tim$ /home/AKMLS/cgi-bin/perl/processJournal-Photo.pl hiccup > -bash: /home/AKMLS/cgi-bin/perl/processJournal-Photo.pl: No such file or directory > linus:journal tim$ echo $? > 127 > > In python, use os.p

Re: popen4 - get exit status

2012-08-27 Thread Dave Angel
According to: http://docs.python.org/library/popen2.html <http://docs.python.org/library/popen2.html> " The only way to retrieve the return codes for the child processes is by using the poll() or wait() methods on the Popen3 <http://docs.python.org/library/popen2.html#popen2.Popen3&

popen4 - get exit status

2012-08-27 Thread Tim Johnson
In bash I do the following: linus:journal tim$ /home/AKMLS/cgi-bin/perl/processJournal-Photo.pl hiccup -bash: /home/AKMLS/cgi-bin/perl/processJournal-Photo.pl: No such file or directory linus:journal tim$ echo $? 127 In python, use os.popen4 I do the following: >>> fin,fout = os.popen4('/home/AKM

Re: nested popen4

2008-10-04 Thread Terry Reedy
julian wrote: Hi all, I know it's a kind of bizarre question but here I go: I want to execute an script using popen4. This script executes a command in turn using popen4 too. The first one throws a 256 exit code. Any suggestions? Popen4 is gone in 3.0 and I presume deprecated in 2.6, rep

nested popen4

2008-10-04 Thread julian
Hi all, I know it's a kind of bizarre question but here I go: I want to execute an script using popen4. This script executes a command in turn using popen4 too. The first one throws a 256 exit code. Any suggestions? Thanks J. -- http://mail.python.org/mailman/listinfo/python-list

Re: popen4 not returning output

2007-08-20 Thread Michael Bentley
On Aug 19, 2007, at 8:58 PM, [EMAIL PROTECTED] wrote: > I am trying to run the following script: > > > #!/usr/bin/python > > import popen2 > > commandToRun = """scp scp_trial.py [EMAIL PROTECTED]:/targetDirectory""" > #commandToRun

Re: popen4 not returning output

2007-08-19 Thread James Stroud
James Stroud wrote: > [EMAIL PROTECTED] wrote: >> I am trying to run the following script: >> >> >> #!/usr/bin/python >> >> import popen2 >> >> commandToRun = """scp scp_trial.py [EMAIL PROTECTED]:/targetDirectory""&q

Re: popen4 not returning output

2007-08-19 Thread James Stroud
[EMAIL PROTECTED] wrote: > I am trying to run the following script: > > > #!/usr/bin/python > > import popen2 > > commandToRun = """scp scp_trial.py [EMAIL PROTECTED]:/targetDirectory""" > #commandToRun = "ls" > print

popen4 not returning output

2007-08-19 Thread hortitude
I am trying to run the following script: #!/usr/bin/python import popen2 commandToRun = """scp scp_trial.py [EMAIL PROTECTED]:/targetDirectory""" #commandToRun = "ls" print commandToRun p_out, p_in = popen2.popen4 (commandToRun) theOut = p_out.rea

proper way to use popen4

2006-06-13 Thread micklee74
hi i have to execute some SQL statements against a database using a SQL client i want to use the os.popen4 module can someone correct the way i use os.popen4? thanks fin = "select * from some_table" #sql statement client = "osql server user password" #sql client syntax fin, fout = os.popen4(client

Re: wait() on Popen4 object from thread?

2006-05-30 Thread Grant Edwards
On 2006-05-30, Grant Edwards <[EMAIL PROTECTED]> wrote: doesn't V > However, the presence/absence of the global affect whether the > OSError happens or not. -- Grant Edwards grante

Re: wait() on Popen4 object from thread?

2006-05-30 Thread Grant Edwards
On 2006-05-30, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Tue, 30 May 2006 03:01:54 -, Grant Edwards <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> watching = False > > You do realize that this is a LOCAL definition, and is NOT the same > "watch

wait() on Popen4 object from thread?

2006-05-29 Thread Grant Edwards
I'm having problems calling the Popen4 object wait() method from a thread. The folloing program produces an error on some machines (but seems to work on others) --8<-- import time import threading import popen2 def monit

Solved: popen4("python -u script.py") redirected to a gui window

2006-01-27 Thread André
Sorry about the single-author thread; I have been googling for answers and trying out for 3 nights... I just want to record to save others the trouble. > Earlier this evening, I wrote: > > Short description: Using a wxPython based app, I would like to take a > > python script in an editor window,

*Almost working* >:-( popen4("python -u script.py") redirected to a gui window

2006-01-27 Thread André
Earlier this evening, I wrote: > Short description: Using a wxPython based app, I would like to take a > python script in an editor window, invoke the python interpreter and > use another window as stdin/stdout/stderr. > [snip] Ok, I got almost everything working ... except the stdin redirection. I

Howto? popen4("python -u script.py") redirected to a gui window

2006-01-27 Thread André
Short description: Using a wxPython based app, I would like to take a python script in an editor window, invoke the python interpreter and use another window as stdin/stdout/stderr. Based on what I've read so far, I've figured that I need to do something like: f_in, f_out = popen4(

Re: popen4

2005-10-19 Thread Ralf Muschall
Ganesan Rajagopal wrote: > Try pexpect instead. http://pexpect.sourceforce.net/ ^ That's a content-free ad site. You probably mean sourceforGe. Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: popen4

2005-10-18 Thread Ganesan Rajagopal
> "billie" == billie <[EMAIL PROTECTED]> writes: > Piet van Oostrum wrote: >> I think you need something like pyexpect for this. > PyExpect seems to be no more mantained. Try pexpect instead. http://pexpect.sourceforce.net/ Ganesan -- Ganesan Rajagopal (rganesan at debian.org) | GPG Key:

Re: popen4

2005-10-18 Thread billie
Piet van Oostrum wrote: > I think you need something like pyexpect for this. PyExpect seems to be no more mantained. -- http://mail.python.org/mailman/listinfo/python-list

Re: popen4

2005-10-17 Thread Piet van Oostrum
>>>>> "billie" <[EMAIL PROTECTED]> (b) wrote: >b> Hi all. I'm trying to execute system commands and capture the output by >b> using popen4: >b> stdout example: >>>>> exec_cmd = popen2.popen4("echo hello!") >>&

popen4

2005-10-16 Thread billie
Hi all. I'm trying to execute system commands and capture the output by using popen4: stdout example: >>>exec_cmd = popen2.popen4("echo hello!") >>>output = exec_cmd[0].read() hello stderr example: >>>exec_cmd = popen2.popen4("echobv hello!")