[Tutor] Executing a command from a specific directory

Sander Sweers sander.sweers at gmail.com
Fri Sep 18 11:58:47 CEST 2009


On Fri, 2009-09-18 at 14:46 +0530, Ansuman Dash wrote:
> 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 without providing people how you accomplish this there is no way to
help.

> 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.

This depends on how you are doing this. But *assuming* you are using
subprocess you can check the returncode from the Popen object. When the
return code is None the command is still running.

Greets
Sander

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?



More information about the Tutor mailing list