Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 How to combine data taken from server between client and GUI?
#7
My mistake:
import socket
 
class Client:
    def __init__(self):
        self.HOST = '192.168.1.59'  # The server's hostname or IP address, NodeMCU IP Address
        self.PORT = 80              # The port used by the server, PORT NUMBER in ARDUINO CODE
 
    def transfer_data(self):
        with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
            s.connect((HOST, PORT))
            s.sendall(b'Hello, world')
            self.data = s.recv(1024)
 
     
# To try run stand-alone
if __name__ == '__main__':
    cl = Client()
    cl.transfer_data()
    print(cl.data)
bescf likes this post
Quote

Top Page

Messages In This Thread
RE: How to combine data taken from server between client and GUI? - by Larz60+ - Apr-01-2019, 03:52 PM

Possibly Related Threads...
Thread Author Replies Views Last Post
  simple udp server/client cardmaker 2 153 Nov-26-2019, 12:36 AM
Last Post: micseydel
  Slow websockets server -> client pattagghiu 0 193 Sep-17-2019, 09:28 AM
Last Post: pattagghiu
  Chat (Client-Server) andresdrr 3 358 Aug-26-2019, 02:01 PM
Last Post: ThomasL
  Python server(Django web site)/client(Python app) connection Junior_Pythoneer 5 407 Jul-05-2019, 05:41 PM
Last Post: noisefloor
  tcp server/client port connection issue valshev 2 2,160 Sep-01-2018, 02:50 PM
Last Post: valshev
  Send data BMP180 between client and server trought module socket smalhao 0 771 Jul-30-2018, 12:56 PM
Last Post: smalhao
  Sending/Receiving Multiple Message from Server or Client Lyperion 0 1,430 Jul-30-2018, 07:52 AM
Last Post: Lyperion
  Need help to make a server/client for DNS Eddie05 1 947 Jun-12-2018, 10:04 AM
Last Post: j.crater
  Simple send and recive string Server/Client Epilepsy 1 1,094 May-01-2018, 08:17 PM
Last Post: ThiefOfTime
  python socketio-client-2 and nod js socketio server communication is not success vmyadhu2 2 3,554 Oct-02-2017, 04:22 AM
Last Post: vmyadhu2

Forum Jump:


Users browsing this thread: 1 Guest(s)