I've problem with python socket  at s.sendto(data,addr)
and my code like this
import socket
    def Main():
        host = '127.0.0.1'
        port = 5000
        s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        s.bind((host, port))
        print("server started")
        while True:
            data, addr = s.recvfrom(1024)
            print ("message from : "+ str(addr))
            print ("from connected user : "+ str(data))
            data = str(data.upper())
            print ("sending : "+ str(data))
            socket.sendto(data, addr)
and result
    socket.sendto(data, addr)
AttributeError: module 'socket' has no attribute 'sendto'
        s.close()
    if __name__ == '__main__':
        Main()
and at UdpClient s.sendto is working
 
     
     
    