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
f628a985
Commit
f628a985
authored
May 19, 1992
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New == syntax
parent
61cfd960
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
10 deletions
+10
-10
Demo/sockets/finger.py
Demo/sockets/finger.py
+1
-1
Demo/sockets/telnet.py
Demo/sockets/telnet.py
+5
-5
Demo/sockets/throughput.py
Demo/sockets/throughput.py
+2
-2
Demo/sockets/udpecho.py
Demo/sockets/udpecho.py
+2
-2
No files found.
Demo/sockets/finger.py
View file @
f628a985
...
...
@@ -37,7 +37,7 @@ def finger(host, args):
def
main
():
options
=
''
i
=
1
while
i
<
len
(
sys
.
argv
)
and
sys
.
argv
[
i
][:
1
]
=
'-'
:
while
i
<
len
(
sys
.
argv
)
and
sys
.
argv
[
i
][:
1
]
=
=
'-'
:
options
=
options
+
sys
.
argv
[
i
]
+
' '
i
=
i
+
1
args
=
sys
.
argv
[
i
:]
...
...
Demo/sockets/telnet.py
View file @
f628a985
...
...
@@ -58,7 +58,7 @@ def main():
#
pid
=
posix
.
fork
()
#
if
pid
=
0
:
if
pid
=
=
0
:
# child -- read stdin, write socket
while
1
:
line
=
sys
.
stdin
.
readline
()
...
...
@@ -82,19 +82,19 @@ def main():
opt
=
''
elif
iac
:
iac
=
0
if
c
=
IAC
:
if
c
=
=
IAC
:
cleandata
=
cleandata
+
c
elif
c
in
(
DO
,
DONT
):
if
c
=
DO
:
print
'(DO)'
,
if
c
=
=
DO
:
print
'(DO)'
,
else
:
print
'(DONT)'
,
opt
=
IAC
+
WONT
elif
c
in
(
WILL
,
WONT
):
if
c
=
WILL
:
print
'(WILL)'
,
if
c
=
=
WILL
:
print
'(WILL)'
,
else
:
print
'(WONT)'
,
opt
=
IAC
+
DONT
else
:
print
'(command)'
,
ord
(
c
)
elif
c
=
IAC
:
elif
c
=
=
IAC
:
iac
=
1
print
'(IAC)'
,
else
:
...
...
Demo/sockets/throughput.py
View file @
f628a985
...
...
@@ -23,9 +23,9 @@ BUFSIZE = 1024
def
main
():
if
len
(
sys
.
argv
)
<
2
:
usage
()
if
sys
.
argv
[
1
]
=
'-s'
:
if
sys
.
argv
[
1
]
=
=
'-s'
:
server
()
elif
sys
.
argv
[
1
]
=
'-c'
:
elif
sys
.
argv
[
1
]
=
=
'-c'
:
client
()
else
:
usage
()
...
...
Demo/sockets/udpecho.py
View file @
f628a985
...
...
@@ -14,9 +14,9 @@ BUFSIZE = 1024
def
main
():
if
len
(
sys
.
argv
)
<
2
:
usage
()
if
sys
.
argv
[
1
]
=
'-s'
:
if
sys
.
argv
[
1
]
=
=
'-s'
:
server
()
elif
sys
.
argv
[
1
]
=
'-c'
:
elif
sys
.
argv
[
1
]
=
=
'-c'
:
client
()
else
:
usage
()
...
...
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