TCP CODE for Python