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
d55f4d1a
Kaydet (Commit)
d55f4d1a
authored
Ara 17, 1993
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
*** empty log message ***
üst
9e80d6f1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
13 deletions
+12
-13
gopher.py
Demo/sockets/gopher.py
+5
-7
radio.py
Demo/sockets/radio.py
+2
-1
jukebox.py
Demo/stdwin/jukebox.py
+1
-1
lpwin.py
Demo/stdwin/lpwin.py
+2
-1
python.py
Demo/stdwin/python.py
+2
-3
No files found.
Demo/sockets/gopher.py
Dosyayı görüntüle @
d55f4d1a
...
...
@@ -200,7 +200,7 @@ def browse_textfile(selector, host, port):
x
=
None
try
:
p
=
os
.
popen
(
'${PAGER-more}'
,
'w'
)
x
=
SaveLines
(
)
.
init
(
p
)
x
=
SaveLines
(
p
)
get_alt_textfile
(
selector
,
host
,
port
,
x
.
writeln
)
except
IOError
,
msg
:
print
'IOError:'
,
msg
...
...
@@ -209,7 +209,7 @@ def browse_textfile(selector, host, port):
f
=
open_savefile
()
if
not
f
:
return
x
=
SaveLines
(
)
.
init
(
f
)
x
=
SaveLines
(
f
)
try
:
get_alt_textfile
(
selector
,
host
,
port
,
x
.
writeln
)
print
'Done.'
...
...
@@ -252,7 +252,7 @@ def browse_binary(selector, host, port):
f
=
open_savefile
()
if
not
f
:
return
x
=
SaveWithProgress
(
)
.
init
(
f
)
x
=
SaveWithProgress
(
f
)
get_alt_binary
(
selector
,
host
,
port
,
x
.
write
,
8
*
1024
)
x
.
close
()
...
...
@@ -268,9 +268,8 @@ typebrowser = {'0': browse_textfile, '1': browse_menu, \
# Class used to save lines, appending a newline to each line
class
SaveLines
:
def
init
(
self
,
f
):
def
__init__
(
self
,
f
):
self
.
f
=
f
return
self
def
writeln
(
self
,
line
):
self
.
f
.
write
(
line
+
'
\n
'
)
def
close
(
self
):
...
...
@@ -280,9 +279,8 @@ class SaveLines:
# Class used to save data while showing progress
class
SaveWithProgress
:
def
init
(
self
,
f
):
def
__init__
(
self
,
f
):
self
.
f
=
f
return
self
def
write
(
self
,
data
):
sys
.
stdout
.
write
(
'#'
)
sys
.
stdout
.
flush
()
...
...
Demo/sockets/radio.py
Dosyayı görüntüle @
d55f4d1a
...
...
@@ -9,5 +9,6 @@ s = socket(AF_INET, SOCK_DGRAM)
s
.
bind
(
''
,
MYPORT
)
while
1
:
data
=
s
.
recv
(
1500
)
data
,
wherefrom
=
s
.
recvfrom
(
1500
,
0
)
sys
.
stderr
.
write
(
`wherefrom`
+
'
\n
'
)
sys
.
stdout
.
write
(
data
)
Demo/stdwin/jukebox.py
Dosyayı görüntüle @
d55f4d1a
...
...
@@ -45,7 +45,7 @@ SFPLAY = '/usr/sbin/sfplay' # Sound playing program
# Global variables
class
struct
()
:
pass
# Class to define featureless structures
class
struct
:
pass
# Class to define featureless structures
G
=
struct
()
# oHlds writable global variables
...
...
Demo/stdwin/lpwin.py
Dosyayı görüntüle @
d55f4d1a
...
...
@@ -86,7 +86,8 @@ def main():
mainloop
.
register
(
win
)
mainloop
.
mainloop
()
def
lpdispatch
(
type
,
win
,
detail
):
def
lpdispatch
(
event
):
type
,
win
,
detail
=
event
if
type
==
WE_CLOSE
or
type
==
WE_CHAR
and
detail
in
(
'q'
,
'Q'
):
mainloop
.
unregister
(
win
)
elif
type
==
WE_DRAW
:
...
...
Demo/stdwin/python.py
Dosyayı görüntüle @
d55f4d1a
...
...
@@ -375,7 +375,7 @@ def do_exec(win):
save_stdout
=
sys
.
stdout
save_stderr
=
sys
.
stderr
try
:
sys
.
stdin
=
sys
.
stdout
=
sys
.
stderr
=
IOWindow
(
)
.
init
(
win
)
sys
.
stdin
=
sys
.
stdout
=
sys
.
stderr
=
IOWindow
(
win
)
win
.
busy
=
1
try
:
exec
(
command
,
win
.
globals
)
...
...
@@ -404,9 +404,8 @@ def do_exec(win):
#
class
IOWindow
:
#
def
init
(
self
,
win
):
def
__init__
(
self
,
win
):
self
.
win
=
win
return
self
#
def
readline
(
self
,
*
unused_args
):
n
=
len
(
inputwindows
)
...
...
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