[Tutor] monitor number of files in a folder

Wayne srilyk at gmail.com
Thu Aug 6 21:49:35 CEST 2009


On Thu, Aug 6, 2009 at 2:33 PM, pedro <pedrooconnell at gmail.com> wrote:

> Hi I am rendering image sequences on a basic render farm that I am
> building. Once all the files in the sequence have been rendered I would like
> to make a quicktime of the sequence automatically. The problem I am having
> is that if one of the computers on the farm is rendering slow the quicktime
> gets made before all the files are rendered.
>
> The variable below called "theNumberOfImages" is the actual # of images
> that have been rendered which is working fine.
> The variable below called "theNumberOfFrames" is the total # of images that
> are supposed to be rendered. What I am trying to do but am not sure how is
> to say:
> As soon as theNumberOfImages is equal to or greater than theNumberOfFrames,
> render the quicktime.
>
> Here is my very bad solution
>
> if theNumberOfImages <= theNumberOfFrames:
>   time.sleep(60)
>   if theNumberOfImages <= theNumberOfFrames:
>       time.sleep(60)
>       if theNumberOfImages <= theNumberOfFrames:
>           time.sleep(60)
> else:
>   os.system('/Volumes/sgtb/lac/common/temp/theQuicktimeCommandTest.sh')


You really just want a  while loop:

while imagecount >= framecount:
    time.sleep(60)

# Call script here

I guess that's the easiest way. Probably not the most effective, but I'm not
sure if the implementation of an alternate solution would be worth the cost.

HTH,
Wayne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090806/9a9bdd8b/attachment.htm>


More information about the Tutor mailing list