libb.validipport

validipport(port)[source]

Check if port is a valid port number.

Parameters:

port (str) – Port string to validate.

Returns:

True if valid port (0-65535).

Return type:

bool

Example:

>>> validipport('9000')
True
>>> validipport('foo')
False
>>> validipport('1000000')
False