How to run a python script twice randomly in a day?

Cameron Simpson cs at zip.com.au
Tue May 21 23:00:23 EDT 2013


On 21May2013 09:54, Dave Angel <davea at davea.name> wrote:
| On 05/21/2013 06:32 AM, Cameron Simpson wrote:
| >On 21May2013 17:56, Chris Angelico <rosuav at gmail.com> wrote:
| >| On Tue, May 21, 2013 at 11:12 AM, Cameron Simpson <cs at zip.com.au> wrote:
| >| > - randrange() is like other python ranges: it does not include the end value.
| >| >   So your call picks a number from 0..58, not 0..59.
| >| >   Say randrange(0,60). Think "start, length".
| >|
| >| Nitpick: It's not start, length; it's start, stop-before. If the start
| >| is 10 and the second argument is 20, you'll get numbers from 10 to 19.
| >| But your conclusion is still accurate :)
| >
| >But it's still a useful thing to think when you're trying to reason
| >about ranges unless you're doing something unusual.
| 
| No, it's only happens to look like length when start is zero.  So as
| a mnemonic, it's highly misleading.

Feh! No self respecting computer scientist would ever count from
other than zero!

Actually, yes, you're right there.

Cheers,
-- 
Cameron Simpson <cs at zip.com.au>

Q: How does a hacker fix a function which doesn't work for all of the elements in its domain?
A: He changes the domain.



More information about the Python-list mailing list