You are viewing an older version (9.3.0). Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython 9.3.0 / IPython / utils / openpy / read_py_url

function

IPython.utils.openpy:read_py_url

source: /IPython/utils/openpy.py :82

Signature

def   read_py_url ( url errors = replace skip_encoding_cookie = True )

Summary

Read a Python file from a URL, using the encoding declared inside the file.

Parameters

url : str

The URL from which to fetch the file.

errors : str

How to handle decoding errors in the file. Options are the same as for bytes.decode(), but here 'replace' is the default.

skip_encoding_cookie : bool

If True (the default), and the encoding declaration is found in the first two lines, that line will be excluded from the output.

Returns

: A unicode string containing the contents of the file.

Aliases

  • IPython.utils.openpy.read_py_url