ID EN
Socket

getservbyname

Python 3.11

Translate an internet service name and protocol name to a port number for that service. The optional protocol name, if given, should be 'tcp' or 'udp', otherwise any protocol will match.

Syntax

PYTHON
socket.getservbyname(servicename[, protocolname])

See Also

auditing event Availability