Python Socket Receiver
This code is very nice and easy to follow along with.



You should check the return value of socket.socket to make sure that the socket was created successfully



Usually, the name given to an error in a try/catch(or except) statement is something along the lines of "err", not "msg".



You should pass an error code to sys.exit so that external programs will know if there were any errors during the execution of the program.



In the while loop of clientthread, you use True to specify an infinite loop.

However, in the while loop just below that function, you use 1. You should stay consistent and use True for that one.



Instead of just printing the data, add a short message before it so the purpose of the number is more easily understood in output.

Example:

print 'Client data: ' + data




I don't believe that the s.close call at the end of your code will actually run.

This may not be necessary, as the socket may close automatically, but I would set up a signal handler to close the socket when someone tries to exit the program. You can use the signal library.

I came up with something like this:

def close_socket():
    s.close()
    sys.exit(0) # success


Then, right before your final while loop:

signal.signal(signal.SIGINT, close_socket)