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

bundles / IPython 9.11.0 / IPython / lib / display / Code

class

IPython.lib.display:Code

source: /IPython/lib/display.py :632

Signature

class   Code ( data = None url = None filename = None language = None )

Members

Summary

Display syntax-highlighted source code.

Extended Summary

This uses Pygments to highlight the code for HTML and Latex output.

Parameters

data : str

The code as a string

url : str

A URL to fetch the code from

filename : str

A local filename to load the code from

language : str

The short name of a Pygments lexer to use for highlighting. If not specified, it will guess the lexer based on the filename or the code. Available lexers: http://pygments.org/docs/lexers/

Aliases

  • IPython.display.Code

Referenced by