def display_ipython(self):

        if IPython is None:
            raise ImportError('IPython is not installed but is required. ' +
                              'Please install IPython >= 3.0 and try again')

        if ipython_less_than_3:
            msg = ('You have IPython {} installed but PyDy only supports '
                   'IPython >= 3.0. Please update IPython and try again.')
            raise ImportError(msg.format(IPython.__version__))

        self.create_static_html(overwrite=True, silent=True)

        # Only create the constants input boxes and the rerun simulation
        # button if the scene was generated with a System.
        if self._system is not None:

            self._initial_conditions_container = widgets.Box()
            self._initial_conditions_container.padding = "10px"
            self._initial_conditions_text_widgets = OrderedDict()
            self._fill_initial_conditions_widgets()
            title = widgets.HTML('<h4 style="margin-left: 5ex;">Initial Conditions</h4>')
            self._initial_conditions_container.children = ((title, ) +
                 tuple(v for v in self._initial_conditions_text_widgets.values()))

            self._constants_container = widgets.Box()
            self._constants_container.padding = "20px"
            self._constants_text_widgets = OrderedDict()
            self._fill_constants_widgets()
            title = widgets.HTML('<h4 style="margin-left: 5ex;">Constants</h4>')
            self._constants_container.children = ((title, ) +
                 tuple(v for v in self._constants_text_widgets.values()))

            self._initialize_rerun_button()

            parameter_input_container = \
                widgets.HBox(children=(self._initial_conditions_container,
                                       self._constants_container))

            display(parameter_input_container)
            display(self._rerun_button)

        ipython_static_url = os.path.relpath(self.pydy_directory, os.getcwd())
        ip_html_file = os.path.join(ipython_static_url, "index_ipython.html")
        with open(ip_html_file, 'r') as html_file:
            html = html_file.read()

        html = html.format(static_url=ipython_static_url,
                           load_url=os.path.join(ipython_static_url,
                                                 self._scene_json_file))

        self._html_widget = widgets.HTML(value=html)
        # NOTE : This overrides the width of the simulation canvas so that it
        # stays within the borders of the IPython notebook.
        self._html_widget._css = [("canvas", "width", "100%"),
                                  ("canvas", "padding-right", "10px")]


        display(self._html_widget)
Displays the scene using an IPython widget inside an IPython
dataset/ETHPy150Open pydy/pydy/pydy/viz/scene.py/Scene.display_ipython