Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #52660

Re: Need somebody schmardter than me

From Roy Smith <roy@panix.com>
Newsgroups comp.lang.python
Subject Re: Need somebody schmardter than me
Date 2013-08-18 16:19 -0400
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <roy-913E78.16195518082013@news.panix.com> (permalink)
References <mailman.2.1376856608.19984.python-list@python.org>

Show all headers | View raw


In article <mailman.2.1376856608.19984.python-list@python.org>,
 Gene Heskett <gheskett@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.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Need somebody schmardter than me Gene Heskett <gheskett@wdtv.com> - 2013-08-18 16:09 -0400
  Re: Need somebody schmardter than me Roy Smith <roy@panix.com> - 2013-08-18 16:19 -0400
    Re: Need somebody schmardter than me Gene Heskett <gheskett@wdtv.com> - 2013-08-18 16:48 -0400
    Re: Need somebody schmardter than me Chris Angelico <rosuav@gmail.com> - 2013-08-18 22:20 +0100
  Re: Need somebody schmardter than me Gene Heskett <gheskett@wdtv.com> - 2013-08-18 19:33 -0400

csiph-web