[Tutor] Executing a command from a specific directory
Ansuman Dash
ansuman.dash at gmail.com
Thu Sep 17 14:40:10 CEST 2009
I am using same process for multiple file download. So I need to download
those one by one.
Moreover some files are very huge (around 120 MB). So I need to make script
to wait before verifying the file is downloaded.
Thanks
AD
On Thu, Sep 17, 2009 at 5:34 PM, Kent Johnson <kent37 at tds.net> wrote:
> On Thu, Sep 17, 2009 at 5:47 AM, Ansuman Dash <ansuman.dash at gmail.com>
> wrote:
> > Hi,
> >
> > I modified my code little bit and it is working fine now,
> >
> > =====================================================
> > if os.access("C:/Python25/Own.log", os.F_OK):
> > f = open("C:/Python25/Own.log")
> > time.sleep(30)
> > =======================================================
> >
> > But I have question to ask, as you can see I am using "time.sleep(30)" to
> > make my code wait. Is there any other way I can write my script to
> resolve
> > synchronization issues.
>
> How is the log being created? Are you waiting for another process to
> finish? You can use the subprocess module to start another process and
> then wait for the process to complete.
>
> Kent
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090917/1f8cb7db/attachment.htm>
More information about the Tutor
mailing list