Message20080
I want a random 32-bit int and do it the obvious way:
lowest, highest = int(-2**31), int(2**31-1)
r = random.randint(lowest, highest)
random.randint throws an exception:
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.2/random.py", line 349, in randint
return self.randrange(a, b+1)
File "/usr/lib/python2.2/random.py", line 328, in
randrange
raise ValueError, "empty range for randrange()"
ValueError: empty range for randrange()
|
|
Date |
User |
Action |
Args |
2007-08-23 14:20:07 | admin | link | issue901285 messages |
2007-08-23 14:20:07 | admin | create | |
|