Python netcat replacement