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
0db85e5d
Kaydet (Commit)
0db85e5d
authored
Agu 02, 2010
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix-up some tkinter demos.
üst
36f72d33
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
10 deletions
+8
-10
AttrDialog.py
Demo/tkinter/guido/AttrDialog.py
+1
-1
ManPage.py
Demo/tkinter/guido/ManPage.py
+4
-4
brownian2.py
Demo/tkinter/guido/brownian2.py
+1
-1
kill.py
Demo/tkinter/guido/kill.py
+2
-4
No files found.
Demo/tkinter/guido/AttrDialog.py
Dosyayı görüntüle @
0db85e5d
...
@@ -120,7 +120,7 @@ class Dialog:
...
@@ -120,7 +120,7 @@ class Dialog:
cl
=
self
.
classes
[
c
]
cl
=
self
.
classes
[
c
]
except
KeyError
:
except
KeyError
:
cl
=
'unknown'
cl
=
'unknown'
if
type
(
cl
)
==
TupleTyp
e
:
if
type
(
cl
)
==
tupl
e
:
cl
=
self
.
enumoption
cl
=
self
.
enumoption
elif
cl
==
'boolean'
:
elif
cl
==
'boolean'
:
cl
=
self
.
booleanoption
cl
=
self
.
booleanoption
...
...
Demo/tkinter/guido/ManPage.py
Dosyayı görüntüle @
0db85e5d
...
@@ -107,13 +107,13 @@ class EditableManPage(ScrolledText):
...
@@ -107,13 +107,13 @@ class EditableManPage(ScrolledText):
# Save this line -- we need one line read-ahead
# Save this line -- we need one line read-ahead
self
.
buffer
=
nextline
self
.
buffer
=
nextline
return
return
if
emptyprog
.
match
(
self
.
buffer
)
>=
0
:
if
emptyprog
.
match
(
self
.
buffer
):
# Buffered line was empty -- set a flag
# Buffered line was empty -- set a flag
self
.
empty
=
1
self
.
empty
=
1
self
.
buffer
=
nextline
self
.
buffer
=
nextline
return
return
textline
=
self
.
buffer
textline
=
self
.
buffer
if
ulprog
.
match
(
nextline
)
>=
0
:
if
ulprog
.
match
(
nextline
):
# Next line is properties for buffered line
# Next line is properties for buffered line
propline
=
nextline
propline
=
nextline
self
.
buffer
=
None
self
.
buffer
=
None
...
@@ -127,7 +127,7 @@ class EditableManPage(ScrolledText):
...
@@ -127,7 +127,7 @@ class EditableManPage(ScrolledText):
self
.
ok
=
1
self
.
ok
=
1
self
.
empty
=
0
self
.
empty
=
0
return
return
if
footerprog
.
match
(
textline
)
>=
0
:
if
footerprog
.
match
(
textline
):
# Footer -- start skipping until next non-blank line
# Footer -- start skipping until next non-blank line
self
.
ok
=
0
self
.
ok
=
0
self
.
empty
=
0
self
.
empty
=
0
...
@@ -190,7 +190,7 @@ def test():
...
@@ -190,7 +190,7 @@ def test():
import
os
import
os
import
sys
import
sys
# XXX This directory may be different on your system
# XXX This directory may be different on your system
MANDIR
=
'
/usr/local/man/mann
'
MANDIR
=
''
DEFAULTPAGE
=
'Tcl'
DEFAULTPAGE
=
'Tcl'
formatted
=
0
formatted
=
0
if
sys
.
argv
[
1
:]
and
sys
.
argv
[
1
]
==
'-f'
:
if
sys
.
argv
[
1
:]
and
sys
.
argv
[
1
]
==
'-f'
:
...
...
Demo/tkinter/guido/brownian2.py
Dosyayı görüntüle @
0db85e5d
...
@@ -32,7 +32,7 @@ def particle(canvas): # particle = iterator over the moves
...
@@ -32,7 +32,7 @@ def particle(canvas): # particle = iterator over the moves
yield
None
yield
None
def
move
(
particle
):
# move the particle at random time
def
move
(
particle
):
# move the particle at random time
particle
.
next
(
)
next
(
particle
)
dt
=
random
.
expovariate
(
LAMBDA
)
dt
=
random
.
expovariate
(
LAMBDA
)
root
.
after
(
int
(
dt
*
1000
),
move
,
particle
)
root
.
after
(
int
(
dt
*
1000
),
move
,
particle
)
...
...
Demo/tkinter/guido/kill.py
Dosyayı görüntüle @
0db85e5d
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
# Tkinter interface to Linux `kill' command.
# Tkinter interface to Linux `kill' command.
from
tkinter
import
*
from
tkinter
import
*
from
string
import
splitfields
from
string
import
split
import
subprocess
import
subprocess
import
os
import
os
...
@@ -26,13 +24,13 @@ class Kill(Frame):
...
@@ -26,13 +24,13 @@ class Kill(Frame):
(
'Hex'
,
'-X'
,
0
)]
(
'Hex'
,
'-X'
,
0
)]
def
kill
(
self
,
selected
):
def
kill
(
self
,
selected
):
c
=
self
.
format_list
[
self
.
format
.
get
()][
2
]
c
=
self
.
format_list
[
self
.
format
.
get
()][
2
]
pid
=
s
plit
(
selected
)[
c
]
pid
=
s
elected
.
split
(
)[
c
]
os
.
system
(
'kill -9 '
+
pid
)
os
.
system
(
'kill -9 '
+
pid
)
self
.
do_update
()
self
.
do_update
()
def
do_update
(
self
):
def
do_update
(
self
):
name
,
option
,
column
=
self
.
format_list
[
self
.
format
.
get
()]
name
,
option
,
column
=
self
.
format_list
[
self
.
format
.
get
()]
s
=
subprocess
.
getoutput
(
'ps -w '
+
option
)
s
=
subprocess
.
getoutput
(
'ps -w '
+
option
)
list
=
s
plitfields
(
s
,
'
\n
'
)
list
=
s
.
split
(
'
\n
'
)
self
.
header
.
set
(
list
[
0
])
self
.
header
.
set
(
list
[
0
])
del
list
[
0
]
del
list
[
0
]
y
=
self
.
frame
.
vscroll
.
get
()[
0
]
y
=
self
.
frame
.
vscroll
.
get
()[
0
]
...
...
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