is_url_connectable¶
- pyhelpers.ops.is_url_connectable(url)[source]¶
Check if the current machine can connect to the given URL.
- Parameters:
url (str) – A valid URL.
- Returns:
True
if the machine can currently connect to the given URL,False
otherwise.- Return type:
bool
Examples:
>>> from pyhelpers.ops import is_url_connectable >>> url_0 = 'https://www.python.org/' >>> is_url_connectable(url_0) True >>> url_1 = 'https://www.python.org1/' >>> is_url_connectable(url_1) False