]> granicus.if.org Git - python/commitdiff
whrandom -> random
authorGuido van Rossum <guido@python.org>
Wed, 20 May 1998 17:13:01 +0000 (17:13 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 20 May 1998 17:13:01 +0000 (17:13 +0000)
Demo/pdist/security.py
Demo/scripts/markov.py
Demo/threads/sync.py
Demo/tkinter/guido/electrons.py
Tools/faqwiz/faqwiz.py

index f9936828a416a85913dc47434e4fc88000670b2d..0ffd511a079d5a0895d8207d2e319da1b621b16f 100755 (executable)
@@ -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
index 6bd62d0249aaa7611532f1a0c6c1f26af5e4e6bb..e1649f1e9dea1d7770c585ef8165bd80b2cd79c2 100755 (executable)
@@ -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 == '-':
index 3044724ae42cbab487d057d4120454bedbc890ce..3ad0fff9e721c696f598530028761f838650136b 100644 (file)
@@ -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
index 377c9ed1b4527210f236956810488fcd79141922..e1fe1cb2e5875ed230967b86aefc8d5bd7af50be 100755 (executable)
@@ -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()
 
index f604fd2235fd36cba70b517fcaa126ce3bc160f5..318b6422ac71247ff54fff66b6752c1a14d2cb86 100644 (file)
@@ -572,12 +572,12 @@ class FaqWizard:
         emit(TAIL_RECENT)
 
     def do_roulette(self):
-        import whrandom
+        import random
         files = self.dir.list()
         if not files: 
             self.error("No entries.")
             return
-        file = whrandom.choice(files)
+        file = random.choice(files)
         self.prologue(T_ROULETTE)
         emit(ROULETTE)
         self.dir.show(file)