looping def.

C

carlos2004

this code is part of a program, where a button send a command to capture
some images form a web cam.When the button is clicked the program will
capture 100 frames in 30 seconds and freeze the actual image, after 30
seconds we can see the image live again,
I´d like to repeat this 10 times pressing the button only one time and at
the end send a message; END.
code down....

aNY HELP....

def OnClick_500(self, evt):

start_time = time.clock()
filename = time.asctime(time.gmtime()).replace('
','_').replace(':','-')
dat = []
while time.clock() < start_time + 30:
dat.append(cam.snap())
print len(dat) , 'frames taken in 30 seconds'

dat = array(dat)
fn =
'c:/PEPE_IMAGES/'+filename+'.GIF'#time.asctime(time.gmtime())+'.GIF'
gIF.Write(dat, fn)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,661
Latest member
sxarexu

Latest Threads

Top