socket

Stdlib — NetworkingPython 2.0+Advanced

Low-level TCP/UDP socket interface

Quick Info

Documentation
Official Docs
Python Version
2.0+
Dependencies
None — Python Standard Library
Install
Included with Python

Learn by Difficulty

Quick Example

python
import socket

print(f"Hostname: {socket.gethostname()}")
print("Socket types:", [s for s in dir(socket) if s.startswith("SOCK_")][:4])

The socket module is part of Python's standard library. Low-level TCP/UDP socket interface.

Try in Playground

Tags

stdlibnetworkingtcpudplow-level

Related Items