Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Hands on the Socket Module in Python

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

import socket
hostname = socket.gethostname()
socket.gethostbyname(hostname)
'172.17.0.3'
[m for m in dir(socket) if "host" in m]
['gethostbyaddr', 'gethostbyname', 'gethostbyname_ex', 'gethostname', 'sethostname']