Send data from client to server using Python sockets in client.py and server.py.
Send data from peer to peer (client to client) using PubNub with pn_client_1.py and pn_client_2.py.
Install the PubNub package with pip (lastest as of 01/2019):
pip install 'pubnub>=4.1.2'
You must put in your free PubNub API keys to use pn_client_1.py and pn_client_2.py. Sign up at https://dashboard.pubnub.com/signup
Watch the tutorial video or read guide in the Python Socket Programming Tutorial PubNub Blog post.