On this page
socket.ntohl
Prev: socket.inet_pton | Up: socket | Next: socket.ntohs
Rel: socket.AddressFamily, socket.close, socket.create_connection, socket.create_server
Ref: docs.python.org — socket.ntohl
Tags: #public #python3 #stdlib #socket
Import
import socket
from socket import ntohl
Signature & Overview
socket.ntohl(integer, /)
Convert a 32-bit unsigned integer from network to host byte order.
Usage
import socket
assert socket.ntohl(socket.htonl(123456)) == 123456
Gotchas
- Network-to-host 32-bit byte-order conversion: Inverse of
htonl().
REPL Inspect
from socket import ntohl
help(ntohl)
Linked from
Related notes
- tuts/python3/stdlib_module/socket/inet_pton Linked here; links to this page; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/ntohs Linked here; links to this page; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/AddressFamily Linked here; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/close Linked here; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/create_connection Linked here; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/create_server Linked here; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/socket Linked here; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/socket/dup shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/error shared tags: #socket, #stdlib