{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d6025316",
   "metadata": {},
   "outputs": [],
   "source": [
    "#!/usr/bin/env python3\n",
    "\n",
    "import socket\n",
    "\n",
    "HOST = '127.0.0.1'  # The server's hostname or IP address\n",
    "PORT = 65432        # The port used by the server\n",
    "\n",
    "with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:\n",
    "    s.connect((HOST, PORT))\n",
    "    s.sendall(b'Hello, world')\n",
    "    data = s.recv(1024)\n",
    "\n",
    "print('Received', repr(data))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
