Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6c3a2cb

Browse files
committed
whrandom -> random
1 parent b26a1b4 commit 6c3a2cb

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

Demo/pdist/security.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ def __init__(self):
2222
raise IOError, "python keyfile %s: cannot open" % keyfile
2323

2424
def _generate_challenge(self):
25-
import whrandom
26-
return whrandom.randint(100, 100000)
25+
import random
26+
return random.randint(100, 100000)
2727

2828
def _compare_challenge_response(self, challenge, response):
2929
return self._encode_challenge(challenge) == response

Demo/scripts/markov.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def get(self):
3131
return seq
3232

3333
def test():
34-
import sys, string, whrandom, getopt
34+
import sys, string, random, getopt
3535
args = sys.argv[1:]
3636
try:
3737
opts, args = getopt.getopt(args, '0123456789cdw')
@@ -59,7 +59,7 @@ def test():
5959
if o == '-q': debug = 0
6060
if o == '-w': do_words = 1
6161
if not args: args = ['-']
62-
m = Markov(histsize, whrandom.choice)
62+
m = Markov(histsize, random.choice)
6363
try:
6464
for filename in args:
6565
if filename == '-':

Demo/threads/sync.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,13 +566,13 @@ def _run_one_sort(tid, a, bar, done):
566566

567567
def test():
568568
global TID, tid, io, wh, randint, alive
569-
import whrandom
570-
randint = whrandom.randint
569+
import random
570+
randint = random.randint
571571

572572
TID = 0 # thread ID (1, 2, ...)
573573
tid = thread.allocate_lock() # for changing TID
574574
io = thread.allocate_lock() # for printing, and 'alive'
575-
wh = thread.allocate_lock() # for calls to whrandom
575+
wh = thread.allocate_lock() # for calls to random
576576
alive = [] # IDs of active threads
577577

578578
NSORTS = 5

Demo/tkinter/guido/electrons.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ def __init__(self, n, bitmap = None):
4141
self.tk.update()
4242

4343
def random_move(self,n):
44-
import whrandom
44+
import random
4545
c = self.canvas
4646
for i in range(1,n+1):
4747
p = self.pieces[i]
48-
x = whrandom.choice(range(-2,4))
49-
y = whrandom.choice(range(-3,4))
48+
x = random.choice(range(-2,4))
49+
y = random.choice(range(-3,4))
5050
c.move(p, x, y)
5151
self.tk.update()
5252

Tools/faqwiz/faqwiz.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,12 +572,12 @@ def do_recent(self):
572572
emit(TAIL_RECENT)
573573

574574
def do_roulette(self):
575-
import whrandom
575+
import random
576576
files = self.dir.list()
577577
if not files:
578578
self.error("No entries.")
579579
return
580-
file = whrandom.choice(files)
580+
file = random.choice(files)
581581
self.prologue(T_ROULETTE)
582582
emit(ROULETTE)
583583
self.dir.show(file)

0 commit comments

Comments
 (0)