bundles / IPython 9.17.0 / IPython / lib / demo / Demo / __init__
function
IPython.lib.demo:Demo.__init__
Signature
def __init__(self, src, title = '', arg_str = '', auto_all = None, format_rst = False, formatter = terminal, style = default)Summary
Make a new demo object. To run the demo, simply call the object.
Extended Summary
See the module docstring for full details and an example (you can use IPython.Demo? in IPython to see it).
Inputs:
src is either a file, or file-like object, or a
string that can be resolved to a filename.
Optional inputs:
title: a string to use as the demo name. Of most use when the demo you are making comes from an object that has no filename, or if you want an alternate denotation distinct from the filename.
arg_str(''): a string of arguments, internally converted to a list just like sys.argv, so the demo script can see a similar environment.
auto_all(None): global flag to run all blocks automatically without confirmation. This attribute overrides the block-level tags and applies to the whole demo. It is an attribute of the object, and can be changed at runtime simply by reassigning it to a boolean value.
format_rst(False): a bool to enable comments and doc strings formatting with pygments rst lexer
formatter('terminal'): a string of pygments formatter name to be used. Useful values for terminals: terminal, terminal256, terminal16m
style('default'): a string of pygments style name to be used.
Aliases
IPython.lib.demo.Demo.__init__