James wrote:
> The subprocess module is meant to replace spawn, popen2, os.system()
> etc. if I'm not mistaken.
Yes.
> Take a look at this excellent resource I've used numerous times:
>
> http://www.python.org/dev/peps/pep-0324/
The same information (with better format but split between mult
Here is my actual code (a section of a long script):
if os.path.isdir(ad) and aRun.split('_')[0]==STN_id[i] and in (aRun.split
('_')[1]):
make_pages=os.path.join(BASEDIR,STN_id[i],SUBDIR[1],'make_pages')
sedstr1="""cat %s | sed -e 's/ASYSmin=[0-9][0-9]*/ASYSmin=%s/g' > jnk"""
% (make_webpage
"Eric Walker" <[EMAIL PROTECTED]> wrote
> The problem is that I have another tool that has an initialization
> period when you start it up. I want to see how long it takes
Have you considered just using the Unix time command?
> So, to time the entire init process, I want to use python.
As a
program. What do you
think?
python newbie...
- Original Message
From: Alan Gauld <[EMAIL PROTECTED]>
To: tutor@python.org
Sent: Saturday, October 27, 2007 4:09:35 PM
Subject: Re: [Tutor] system call
"Eric Walker" <[EMAIL PROTECTED]> wrote
> I am trying to
"John" <[EMAIL PROTECTED]> wrote
> for i in attempts: #attempts holds strings of shellscripts
>cmd="%s which runs many different shell scripts and takes
> about an
> hour" % (i)
>os.system(cmd)
>#debugging
>print "Finished with %s" % (i)
>raw_input("More
"Eric Walker" <[EMAIL PROTECTED]> wrote
> I am trying to run a timing script but I need the python program
> to stop and wait for the executable to finish. Does anyone have
> any examples of doing this?
There are several ways to do it depending on what exactly
you are trying to do. We need a
John wrote:
> I have the exact same situation, but system doesn't seem to wait. Here
> is my pseudo code:
>
> for i in attempts: #attempts holds strings of shellscripts
> cmd="%s which runs many different shell scripts and takes about
> an hour" % (i)
> os.system(cmd)
> #d
How about using subprocess.Popen( ... ).wait()?
I believe subprocess.call() will wait until the process is finished,
too.
The subprocess module is meant to replace spawn, popen2, os.system()
etc. if I'm not mistaken.
Take a look at this excellent resource I've used numerous times:
http://ww
I have the exact same situation, but system doesn't seem to wait. Here is my
pseudo code:
for i in attempts: #attempts holds strings of shellscripts
cmd="%s which runs many different shell scripts and takes about an
hour" % (i)
os.system(cmd)
#debugging
print "Fini
disregard this one. I found the answer. I was using spawn instead of os.system.
Thanks.
- Original Message
From: Eric Walker <[EMAIL PROTECTED]>
To: tutor@python.org
Sent: Saturday, October 27, 2007 9:55:05 AM
Subject: [Tutor] system call
Hello,
I am trying to run a timing script but
10 matches
Mail list logo