Python code for UDP sockets