Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
6c3a2cbc
Commit
6c3a2cbc
authored
May 20, 1998
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
whrandom -> random
parent
b26a1b4e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
12 deletions
+12
-12
Demo/pdist/security.py
Demo/pdist/security.py
+2
-2
Demo/scripts/markov.py
Demo/scripts/markov.py
+2
-2
Demo/threads/sync.py
Demo/threads/sync.py
+3
-3
Demo/tkinter/guido/electrons.py
Demo/tkinter/guido/electrons.py
+3
-3
Tools/faqwiz/faqwiz.py
Tools/faqwiz/faqwiz.py
+2
-2
No files found.
Demo/pdist/security.py
View file @
6c3a2cbc
...
...
@@ -22,8 +22,8 @@ class Security:
raise
IOError
,
"python keyfile %s: cannot open"
%
keyfile
def
_generate_challenge
(
self
):
import
wh
random
return
wh
random
.
randint
(
100
,
100000
)
import
random
return
random
.
randint
(
100
,
100000
)
def
_compare_challenge_response
(
self
,
challenge
,
response
):
return
self
.
_encode_challenge
(
challenge
)
==
response
...
...
Demo/scripts/markov.py
View file @
6c3a2cbc
...
...
@@ -31,7 +31,7 @@ class Markov:
return
seq
def
test
():
import
sys
,
string
,
wh
random
,
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
,
wh
random
.
choice
)
m
=
Markov
(
histsize
,
random
.
choice
)
try
:
for
filename
in
args
:
if
filename
==
'-'
:
...
...
Demo/threads/sync.py
View file @
6c3a2cbc
...
...
@@ -566,13 +566,13 @@ def _run_one_sort(tid, a, bar, done):
def
test
():
global
TID
,
tid
,
io
,
wh
,
randint
,
alive
import
wh
random
randint
=
wh
random
.
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
wh
random
wh
=
thread
.
allocate_lock
()
# for calls to random
alive
=
[]
# IDs of active threads
NSORTS
=
5
...
...
Demo/tkinter/guido/electrons.py
View file @
6c3a2cbc
...
...
@@ -41,12 +41,12 @@ class Electrons:
self
.
tk
.
update
()
def
random_move
(
self
,
n
):
import
wh
random
import
random
c
=
self
.
canvas
for
i
in
range
(
1
,
n
+
1
):
p
=
self
.
pieces
[
i
]
x
=
wh
random
.
choice
(
range
(
-
2
,
4
))
y
=
wh
random
.
choice
(
range
(
-
3
,
4
))
x
=
random
.
choice
(
range
(
-
2
,
4
))
y
=
random
.
choice
(
range
(
-
3
,
4
))
c
.
move
(
p
,
x
,
y
)
self
.
tk
.
update
()
...
...
Tools/faqwiz/faqwiz.py
View file @
6c3a2cbc
...
...
@@ -572,12 +572,12 @@ class FaqWizard:
emit(TAIL_RECENT)
def do_roulette(self):
import
wh
random
import random
files = self.dir.list()
if not files:
self.error("No entries.")
return
file =
wh
random.choice(files)
file = random.choice(files)
self.prologue(T_ROULETTE)
emit(ROULETTE)
self.dir.show(file)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment