aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Tools/demo/rpython.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-10-03 17:09:02 +0200
committerGitHub <noreply@github.com>2022-10-03 17:09:02 +0200
commit64fe34371722d90448e0d1a0c04e7ed106f5f70a (patch)
tree3469166def39cfc26dfdce75062fddd5ab0d1d98 /Tools/demo/rpython.py
parente6f9ec5c031bd996fcd5f463c407beef0b743b49 (diff)
downloadcpython-64fe34371722d90448e0d1a0c04e7ed106f5f70a.tar.gz
cpython-64fe34371722d90448e0d1a0c04e7ed106f5f70a.zip
gh-97681: Remove Tools/demo/ directory (#97682)
Remove the Tools/demo/ directory which contained old demo scripts. A copy can be found in the old-demos project: https://github.com/gvanrossum/old-demos Remove the following old demo scripts: * beer.py * eiffel.py * hanoi.py * life.py * markov.py * mcast.py * queens.py * redemo.py * rpython.py * rpythond.py * sortvisu.py * spreadsheet.py * vector.py Changes: * Remove a reference to the redemo.py script in the regex howto documentation. * Remove a reference to the removed Tools/demo/ directory in the curses documentation. * Update PC/layout/ to remove the reference to Tools/demo/ directory.
Diffstat (limited to 'Tools/demo/rpython.py')
-rwxr-xr-xTools/demo/rpython.py37
1 files changed, 0 insertions, 37 deletions
diff --git a/Tools/demo/rpython.py b/Tools/demo/rpython.py
deleted file mode 100755
index 11f72cb3dd2..00000000000
--- a/Tools/demo/rpython.py
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env python3
-
-"""
-Remote python client.
-Execute Python commands remotely and send output back.
-"""
-
-import sys
-from socket import socket, AF_INET, SOCK_STREAM, SHUT_WR
-
-PORT = 4127
-BUFSIZE = 1024
-
-def main():
- if len(sys.argv) < 3:
- print("usage: rpython host command")
- sys.exit(2)
- host = sys.argv[1]
- port = PORT
- i = host.find(':')
- if i >= 0:
- port = int(host[i+1:])
- host = host[:i]
- command = ' '.join(sys.argv[2:])
- with socket(AF_INET, SOCK_STREAM) as s:
- s.connect((host, port))
- s.send(command.encode())
- s.shutdown(SHUT_WR)
- reply = b''
- while True:
- data = s.recv(BUFSIZE)
- if not data:
- break
- reply += data
- print(reply.decode(), end=' ')
-
-main()