In python 3.5 is it possible to send multiple messages with
sock.send(msg) * 10
if list-creation side-effect is not a problem, then you can do it as a list comprehension as well:
[sock.send(msg) for _ in range(10)]
_ is a sort of "throwaway" variable, you can use any other identifier name there.