'Show a syntax-highlighted file through a pager.
This magic is similar to the cat utility, but it will assume the file
to be Python source and will show it with syntax highlighting.
This magic command can either take a local filename, an url,
an history range (see %history) or a macro as argument ::
%pycat myscript.py
%pycat 7-27
%pycat myMacro
%pycat http://www.example.com/myscript.py'

@line_magic
def pycat(self, parameter_s=''):

    if (not parameter_s):
        raise UsageError('Missing    filename,    URL,    input    history    range,    or    macro.')
    try:
        cont = self.shell.find_user_code(parameter_s, skip_encoding_cookie=False)
    except (ValueError, IOError):
        print 'Error:    no    such    file,    variable,    URL,    history    range    or    macro'
        return
    page.page(self.shell.pycolorize(source_to_unicode(cont)))
