Download pool/shard010/Python/0089265_s4.py from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 421 Bytes
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard010/Python/0089265_s4.py
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard010/Python/0089265_s4.py
-
curl -L -o 0089265_s4.py https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard010/Python/0089265_s4.py
421 Bytes
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # Author: Janice Cheng | |
| import socket | |
| ip_port = ('127.0.0.1',8080,) | |
| s=socket.socket() | |
| s.bind(ip_port) | |
| s.listen(5) | |
| while True: | |
| conn, addr = s.accept() | |
| conn.sendall(bytes('hello',encoding='utf-8')) | |
| while True: | |
| recv_bytes = conn.recv(1024) | |
| if str(recv_bytes,encoding='utf-8') == 'q': | |
| break | |
| conn.sendall(recv_bytes) | |
| s.close() |