On Mon, Apr 8, 2013 at 10:22 PM, Dave Angel wrote:
> On 04/08/2013 08:01 AM, Dylan Evans wrote:
>
>> On Mon, Apr 8, 2013 at 9:48 PM, Alain Ketterlin <
>> al...@dpt-info.u-strasbg.fr
>>
>>> wrote:
>>>
>>
>> loial writes:
>>>
>>> I want to call a child process to run a shell script and wait for
On 04/08/2013 07:00 AM, loial wrote:
I want to call a child process to run a shell script and wait for that script
to finish. Will the code below wait for the script to finish? If not then how
do I make it wait?
Any help appreciated.
import subprocess
command = "/home/john/myscript"
proces
On 04/08/2013 08:01 AM, Dylan Evans wrote:
On Mon, Apr 8, 2013 at 9:48 PM, Alain Ketterlin
wrote:
loial writes:
I want to call a child process to run a shell script and wait for that
script to finish. Will the code below wait for the script to finish?
If not then how do I make it wait?
[.
On Mon, Apr 8, 2013 at 9:48 PM, Alain Ketterlin wrote:
> loial writes:
>
> > I want to call a child process to run a shell script and wait for that
> > script to finish. Will the code below wait for the script to finish?
> > If not then how do I make it wait?
> [...]
> > process = subprocess.Pop
loial writes:
> I want to call a child process to run a shell script and wait for that
> script to finish. Will the code below wait for the script to finish?
> If not then how do I make it wait?
[...]
> process = subprocess.Popen(command,
> stdin=subprocess.PIPE,stdout=subprocess.PIPE, stderr=su
I want to call a child process to run a shell script and wait for that script
to finish. Will the code below wait for the script to finish? If not then how
do I make it wait?
Any help appreciated.
import subprocess
command = "/home/john/myscript"
process = subprocess.Popen(command,
stdin=su
On Sun, 11 Dec 2011 22:02:23 -0800, Chris Rebert wrote:
> p = subprocess.Popen(['du', '-sh'], cwd='/Users/jay/.Trash/',
> stdout=subprocess.PIPE)
> Alternatively, you can opt to use the shell by passing shell=True as
> an argument.
Except that the OP is talking about a directory passed
> import subprocess
> p = subprocess.Popen(['du', '-sh'], cwd='/Users/jay/.Trash/',
>> stdout=subprocess.PIPE)
> out, err = p.communicate()
> out
>> ' 11M\t.\n'
> You might prefer to use subprocess.check_output(); it slightly
> simplifies your code:
> http://docs.python.or
On Sun, Dec 11, 2011 at 8:39 PM, wrote:
> Wondering if anyone could shed some light on the subprocess module? I'll
> admit I'm not that great at the shell.
>
> If I was wanting to get the size of the trash (on OS X), I could use:
>
os.system('du -sh ~/.Trash/')
> 11M /Users/jay/.Trash/
On 12/11/2011 10:39 PM, jyoun...@kc.rr.com wrote:
> And another question - why can't I use the tilde as a shortcut to the home
> directory?
Because subprocess doesn't use the shell (which is what expands the
tilde to the invoking user's home directory). I recommend using
os.path.join and os.enviro
Wondering if anyone could shed some light on the subprocess module? I'll admit
I'm not that great at the shell.
If I was wanting to get the size of the trash (on OS X), I could use:
>>> os.system('du -sh ~/.Trash/')
11M/Users/jay/.Trash/
0
Which gives me what I want. However, I've been r
On 11/26/2010 12:18 AM, Tim Harig wrote:
> On 2010-11-25, Hugo Léveillé wrote:
>> I'm starting various application using subprocess.Popen without any
>> problem. The problem is with application inside "Program Files". It
>> looks like subprocess is stopping the application string after
>> "Program
On 01/-10/-28163 02:59 PM, Hugo Léveillé wrote:
I'm starting various application using subprocess.Popen without any
problem. The problem is with application inside "Program Files". It
looks like subprocess is stopping the application string after
"Program". I tried puting the programe name inside
On 25/11/2010 22:56, Hugo Léveillé wrote:
I'm starting various application using subprocess.Popen without any
problem. The problem is with application inside "Program Files". It
looks like subprocess is stopping the application string after
"Program". I tried puting the programe name inside doubl
On 2010-11-25, Hugo Léveillé wrote:
> I'm starting various application using subprocess.Popen without any
> problem. The problem is with application inside "Program Files". It
> looks like subprocess is stopping the application string after
> "Program". I tried puting the programe name inside doub
I'm starting various application using subprocess.Popen without any
problem. The problem is with application inside "Program Files". It
looks like subprocess is stopping the application string after
"Program". I tried puting the programe name inside double quote like
'"Program File*..."'. No luck.
On Jan 6, 1:18 pm, s...@pobox.com wrote:
> Roger> .setDaemon(True) means the thread gets destroyed when the program
> Roger> exits and default .setDaemon(False) means that the thread
> Roger> continues to process even when the main program is gone?
>
> Approximately. The main thread (a
Roger> .setDaemon(True) means the thread gets destroyed when the program
Roger> exits and default .setDaemon(False) means that the thread
Roger> continues to process even when the main program is gone?
Approximately. The main thread (and thus the program) will exit only when
all non-
On Jan 6, 7:46 am, Duncan Booth wrote:
> "Alexi Zuo" wrote:
> > Hi everyone,
>
> > Here I have a simple program which starts a thread and the thread use
> > Popen to execute a shell cmd which needs a long time. I want to stop
> > the thread once I type "ctrl+C" (KeyboardInterrupt). But in fact t
"Alexi Zuo" wrote:
> Hi everyone,
>
> Here I have a simple program which starts a thread and the thread use
> Popen to execute a shell cmd which needs a long time. I want to stop
> the thread once I type "ctrl+C" (KeyboardInterrupt). But in fact this
> program enters a dead loop. Can anyone tel
Hi everyone,
Here I have a simple program which starts a thread and the thread use
Popen to execute a shell cmd which needs a long time. I want to stop
the thread once I type "ctrl+C" (KeyboardInterrupt). But in fact this
program enters a dead loop. Can anyone tell me what is wrong?
Alex
from s
Ernesto wrote:
> I'm opening a telnet session with the subprocess call below. I then
> wait ten seconds and attempt to terminate the telnet window I created.
> Unfortuantely, the telnet window remains after the 'TerminateProcess"
> call below. This software works great for opening an executable
Ernesto wrote:
> > > tn = telnetlib.Telnet("localhost",6000)
> > > print tn.read_all()
> > > # CRASH
> >
> > that's an unusual error message. are you sure you didn't get a
> > traceback? if so, what did it say?
>
> I was running it directly in a python shell. After the tn.read_all()
> call, the
Fredrik Lundh wrote:
> Ernesto wrote:
>
> > Plus, everytime, I tried to use the read_all object, my program crashed
> > pretty hard...
> >
> > tn = telnetlib.Telnet("localhost",6000)
> > print tn.read_all()
> > # CRASH
>
> that's an unusual error message. are you sure you didn't get a
> traceback
Ernesto wrote:
> Plus, everytime, I tried to use the read_all object, my program crashed
> pretty hard...
>
> tn = telnetlib.Telnet("localhost",6000)
> print tn.read_all()
> # CRASH
that's an unusual error message. are you sure you didn't get a
traceback? if so, what did it say?
--
http:/
Diez B. Roggisch wrote:
> Ernesto wrote:
>
> > I'm opening a telnet session with the subprocess call below. I then
> > wait ten seconds and attempt to terminate the telnet window I created.
> > Unfortuantely, the telnet window remains after the 'TerminateProcess"
> > call below. This software wo
Ernesto wrote:
> I'm opening a telnet session with the subprocess call below. I then
> wait ten seconds and attempt to terminate the telnet window I created.
> Unfortuantely, the telnet window remains after the 'TerminateProcess"
> call below. This software works great for opening an executable
I'm opening a telnet session with the subprocess call below. I then
wait ten seconds and attempt to terminate the telnet window I created.
Unfortuantely, the telnet window remains after the 'TerminateProcess"
call below. This software works great for opening an executable
directly (i.e. Handle =
28 matches
Mail list logo