On this page
  1. socket.ntohs
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

socket.ntohs

Prev: socket.ntohl | Up: socket | Next: socket.recv_fds
Rel: socket.AddressFamily, socket.close, socket.create_connection, socket.create_server
Ref: docs.python.org — socket.ntohs
Tags: #public #python3 #stdlib #socket


Import

import socket
from socket import ntohs

Signature & Overview

socket.ntohs(integer, /)

Convert a 16-bit unsigned integer from network to host byte order.

Usage

import socket

assert socket.ntohs(socket.htons(443)) == 443

Gotchas

REPL Inspect

from socket import ntohs
help(ntohs)

Linked from

Related notes