[Tutor] Executing a command from a specific directory

Ansuman Dash ansuman.dash at gmail.com
Fri Sep 18 11:16:23 CEST 2009


Hi,

I have written it like that. It is like press 1 and it ll download file1 and
press 2 it ll download file2 etc....

But my question was I am using "time.sleep()" to make my script to wait for
the file download and then validate it in log file, so is there any other
way I can synchronize my code with the download.

I am asking this because some files are very huge (120MB) and download also
depends on N/W bandwidth so sometimes it ll be done in 30mins and some times
it takes 60 mins. So I can't rely on "time.sleep()"

Thanks,
Ansu

On Fri, Sep 18, 2009 at 12:21 PM, Lie Ryan <lie.1296 at gmail.com> wrote:

> Ansuman Dash wrote:
>
>> I am downloading files using various command (because files are different)
>> meant for a executable.
>>
>
> What is "various commands"? Are you using wget/curl or similar command-line
> downloader programs? Or are you using a python-based script (that uses
> urllib)? Or are you using a GUI-based downloader?
>
> Then how do you invoke those "various commands"? Are you using a separate
> python and subprocess/popen to invoke them? Or are you using shell script?
> Or do you start them manually?
>
>  So I have created event driven program to download these files one by one.
>> But some files are very huge so I want to know how can I synchronize it with
>> my code.
>>
>
> Can you modify this "event driven program" so it would call your script
> when the files finished downloading?
>
>  That means I want to make my code wait for the complete download of that
>> file and then I ll read the log file and validate that download is
>> successful.
>>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090918/5b405433/attachment.htm>


More information about the Tutor mailing list