psychopy.web - Web methods

Test for access

psychopy.web.haveInternetAccess(forceCheck=False)[source]

Detect active internet connection or fail quickly.

If forceCheck is False, will rely on a cached value if possible.

psychopy.web.requireInternetAccess(forceCheck=False)[source]

Checks for access to the internet, raise error if no access.

Proxy set-up and testing

psychopy.web.setupProxy(log=True)[source]

Set up the urllib proxy if possible.

The function will use the following methods in order to try and determine proxies:

  1. standard urllib.request.urlopen (which will use any statically-defined http-proxy settings)
  2. previous stored proxy address (in prefs)
  3. proxy.pac files if these have been added to system settings
  4. auto-detect proxy settings (WPAD technology)
Returns:True (success) or False (failure)

Back to top