Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
6c3a2cbc
Kaydet (Commit)
6c3a2cbc
authored
May 20, 1998
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
whrandom -> random
üst
b26a1b4e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
12 deletions
+12
-12
security.py
Demo/pdist/security.py
+2
-2
markov.py
Demo/scripts/markov.py
+2
-2
sync.py
Demo/threads/sync.py
+3
-3
electrons.py
Demo/tkinter/guido/electrons.py
+3
-3
faqwiz.py
Tools/faqwiz/faqwiz.py
+2
-2
No files found.
Demo/pdist/security.py
Dosyayı görüntüle @
6c3a2cbc
...
@@ -22,8 +22,8 @@ class Security:
...
@@ -22,8 +22,8 @@ class Security:
raise
IOError
,
"python keyfile
%
s: cannot open"
%
keyfile
raise
IOError
,
"python keyfile
%
s: cannot open"
%
keyfile
def
_generate_challenge
(
self
):
def
_generate_challenge
(
self
):
import
wh
random
import
random
return
wh
random
.
randint
(
100
,
100000
)
return
random
.
randint
(
100
,
100000
)
def
_compare_challenge_response
(
self
,
challenge
,
response
):
def
_compare_challenge_response
(
self
,
challenge
,
response
):
return
self
.
_encode_challenge
(
challenge
)
==
response
return
self
.
_encode_challenge
(
challenge
)
==
response
...
...
Demo/scripts/markov.py
Dosyayı görüntüle @
6c3a2cbc
...
@@ -31,7 +31,7 @@ class Markov:
...
@@ -31,7 +31,7 @@ class Markov:
return
seq
return
seq
def
test
():
def
test
():
import
sys
,
string
,
wh
random
,
getopt
import
sys
,
string
,
random
,
getopt
args
=
sys
.
argv
[
1
:]
args
=
sys
.
argv
[
1
:]
try
:
try
:
opts
,
args
=
getopt
.
getopt
(
args
,
'0123456789cdw'
)
opts
,
args
=
getopt
.
getopt
(
args
,
'0123456789cdw'
)
...
@@ -59,7 +59,7 @@ def test():
...
@@ -59,7 +59,7 @@ def test():
if
o
==
'-q'
:
debug
=
0
if
o
==
'-q'
:
debug
=
0
if
o
==
'-w'
:
do_words
=
1
if
o
==
'-w'
:
do_words
=
1
if
not
args
:
args
=
[
'-'
]
if
not
args
:
args
=
[
'-'
]
m
=
Markov
(
histsize
,
wh
random
.
choice
)
m
=
Markov
(
histsize
,
random
.
choice
)
try
:
try
:
for
filename
in
args
:
for
filename
in
args
:
if
filename
==
'-'
:
if
filename
==
'-'
:
...
...
Demo/threads/sync.py
Dosyayı görüntüle @
6c3a2cbc
...
@@ -566,13 +566,13 @@ def _run_one_sort(tid, a, bar, done):
...
@@ -566,13 +566,13 @@ def _run_one_sort(tid, a, bar, done):
def
test
():
def
test
():
global
TID
,
tid
,
io
,
wh
,
randint
,
alive
global
TID
,
tid
,
io
,
wh
,
randint
,
alive
import
wh
random
import
random
randint
=
wh
random
.
randint
randint
=
random
.
randint
TID
=
0
# thread ID (1, 2, ...)
TID
=
0
# thread ID (1, 2, ...)
tid
=
thread
.
allocate_lock
()
# for changing TID
tid
=
thread
.
allocate_lock
()
# for changing TID
io
=
thread
.
allocate_lock
()
# for printing, and 'alive'
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
alive
=
[]
# IDs of active threads
NSORTS
=
5
NSORTS
=
5
...
...
Demo/tkinter/guido/electrons.py
Dosyayı görüntüle @
6c3a2cbc
...
@@ -41,12 +41,12 @@ class Electrons:
...
@@ -41,12 +41,12 @@ class Electrons:
self
.
tk
.
update
()
self
.
tk
.
update
()
def
random_move
(
self
,
n
):
def
random_move
(
self
,
n
):
import
wh
random
import
random
c
=
self
.
canvas
c
=
self
.
canvas
for
i
in
range
(
1
,
n
+
1
):
for
i
in
range
(
1
,
n
+
1
):
p
=
self
.
pieces
[
i
]
p
=
self
.
pieces
[
i
]
x
=
wh
random
.
choice
(
range
(
-
2
,
4
))
x
=
random
.
choice
(
range
(
-
2
,
4
))
y
=
wh
random
.
choice
(
range
(
-
3
,
4
))
y
=
random
.
choice
(
range
(
-
3
,
4
))
c
.
move
(
p
,
x
,
y
)
c
.
move
(
p
,
x
,
y
)
self
.
tk
.
update
()
self
.
tk
.
update
()
...
...
Tools/faqwiz/faqwiz.py
Dosyayı görüntüle @
6c3a2cbc
...
@@ -572,12 +572,12 @@ class FaqWizard:
...
@@ -572,12 +572,12 @@ class FaqWizard:
emit
(
TAIL_RECENT
)
emit
(
TAIL_RECENT
)
def
do_roulette
(
self
):
def
do_roulette
(
self
):
import
wh
random
import
random
files
=
self
.
dir
.
list
()
files
=
self
.
dir
.
list
()
if
not
files
:
if
not
files
:
self
.
error
(
"No entries."
)
self
.
error
(
"No entries."
)
return
return
file
=
wh
random
.
choice
(
files
)
file
=
random
.
choice
(
files
)
self
.
prologue
(
T_ROULETTE
)
self
.
prologue
(
T_ROULETTE
)
emit
(
ROULETTE
)
emit
(
ROULETTE
)
self
.
dir
.
show
(
file
)
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