diff options
Diffstat (limited to 'Demo')
-rwxr-xr-x | Demo/pdist/security.py | 4 | ||||
-rwxr-xr-x | Demo/scripts/markov.py | 4 | ||||
-rw-r--r-- | Demo/threads/sync.py | 6 | ||||
-rwxr-xr-x | Demo/tkinter/guido/electrons.py | 6 |
4 files changed, 10 insertions, 10 deletions
diff --git a/Demo/pdist/security.py b/Demo/pdist/security.py index f993682..0ffd511 100755 --- a/Demo/pdist/security.py +++ b/Demo/pdist/security.py @@ -22,8 +22,8 @@ class Security: raise IOError, "python keyfile %s: cannot open" % keyfile def _generate_challenge(self): - import whrandom - return whrandom.randint(100, 100000) + import random + return random.randint(100, 100000) def _compare_challenge_response(self, challenge, response): return self._encode_challenge(challenge) == response diff --git a/Demo/scripts/markov.py b/Demo/scripts/markov.py index 6bd62d0..e1649f1 100755 --- a/Demo/scripts/markov.py +++ b/Demo/scripts/markov.py @@ -31,7 +31,7 @@ class Markov: return seq def test(): - import sys, string, whrandom, getopt + import sys, string, random, getopt args = sys.argv[1:] try: opts, args = getopt.getopt(args, '0123456789cdw') @@ -59,7 +59,7 @@ def test(): if o == '-q': debug = 0 if o == '-w': do_words = 1 if not args: args = ['-'] - m = Markov(histsize, whrandom.choice) + m = Markov(histsize, random.choice) try: for filename in args: if filename == '-': diff --git a/Demo/threads/sync.py b/Demo/threads/sync.py index 3044724..3ad0fff 100644 --- a/Demo/threads/sync.py +++ b/Demo/threads/sync.py @@ -566,13 +566,13 @@ def _run_one_sort(tid, a, bar, done): def test(): global TID, tid, io, wh, randint, alive - import whrandom - randint = whrandom.randint + import random + randint = random.randint TID = 0 # thread ID (1, 2, ...) tid = thread.allocate_lock() # for changing TID io = thread.allocate_lock() # for printing, and 'alive' - wh = thread.allocate_lock() # for calls to whrandom + wh = thread.allocate_lock() # for calls to random alive = [] # IDs of active threads NSORTS = 5 diff --git a/Demo/tkinter/guido/electrons.py b/Demo/tkinter/guido/electrons.py index 377c9ed..e1fe1cb 100755 --- a/Demo/tkinter/guido/electrons.py +++ b/Demo/tkinter/guido/electrons.py @@ -41,12 +41,12 @@ class Electrons: self.tk.update() def random_move(self,n): - import whrandom + import random c = self.canvas for i in range(1,n+1): p = self.pieces[i] - x = whrandom.choice(range(-2,4)) - y = whrandom.choice(range(-3,4)) + x = random.choice(range(-2,4)) + y = random.choice(range(-3,4)) c.move(p, x, y) self.tk.update() |