Need somebody schmardter than me

Roy Smith roy at panix.com
Sun Aug 18 16:19:55 EDT 2013


In article <mailman.2.1376856608.19984.python-list at python.org>,
 Gene Heskett <gheskett at wdtv.com> wrote:

[much that doesn't appear to have anything to do with Python elided]

> When cheese runs this camera, there is a several second delay while cheese 
> is apparently talking to it to establish the correct output format before 
> cheese starts displaying its output, so I am wondering if an initialization 
> time delay might be the fix,

In general, when you have some sort of synchronization problem, i.e., 
"this piece of code must not start running until that other thing is 
completed", sticking in a time delay is:

1) Almost always the wrong thing to do.

2) Very often the most simple solution.

How it can simultaneously be both of these is left as an exercise for 
the reader :-)

> but I haven't a clue about how to go about that in python

import time
time.sleep(1.5)

will sleep for 1.5 seconds.



More information about the Python-list mailing list