Last active
March 28, 2018 16:18
-
-
Save sjsakib/5b5f628e6b6054624c7b75c5edfe124e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
host = 'localhost' | |
port = 8000 | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sock.connect((host, port)) | |
sock.send('Ping!'.encode()) | |
message = sock.recv(4096) | |
print('Server said: ' + message.decode()) | |
sock.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment