STEM 隨筆︰古典力學︰模擬術【小工具】五

隨著範例腳步

ipywidgets/docs/source/examples/Index.ipynb

 

好好玩玩各種『小工具』︰

……

 

熟悉認識 IPython 豐富之物件顯示用法︰


Important

This documentation covers IPython versions 6.0 and higher. Beginning with version 6.0, IPython stopped supporting compatibility with Python versions lower than 3.3 including all versions of Python 2.7.

If you are looking for an IPython version compatible with Python 2.7, please use the IPython 5.x LTS release and refer to its documentation (LTS is the long term support release).

Module: display

Public API for display tools in IPython.

23 Classes

classIPython.display.Audio(data=None, filename=None, url=None, embed=None, rate=None,autoplay=False)
Bases: IPython.core.display.DisplayObject

Create an audio object.

When this object is returned by an input cell or passed to the display function, it will result in Audio controls being displayed in the frontend (only works in the notebook).

………

16 Functions

IPython.display.clear_output(wait=False)
Clear the output of the current cell receiving output.

Parameters: wait (bool [default: false]) – Wait to clear the output until new output is available to replace it.
IPython.display.display(*objs, include=None, exclude=None, metadata=None, transient=None,display_id=None, **kwargs)
Display a Python object in all frontends.

By default all representations will be computed and sent to the frontends. Frontends can decide which representation is used and how.

In terminal IPython this will be similar to using print(), for use in richer frontends see Jupyter notebook examples with rich display logic.

Parameters:
  • objs (tuple of objects) – The Python objects to display.
  • raw (bool, optional) – Are the objects to be displayed already mimetype-keyed dicts of raw display data, or Python objects that need to be formatted before display? [default: False]
  • include (list, tuple or set, optional) – A list of format type strings (MIME types) to include in the format data dict. If this is set only the format types included in this list will be computed.
  • exclude (list, tuple or set, optional) – A list of format type strings (MIME types) to exclude in the format data dict. If this is set all format types will be computed, except for those included in this argument.
  • metadata (dict, optional) – A dictionary of metadata to associate with the output. mime-type keys in this dictionary will be associated with the individual representation formats, if they exist.
  • transient (dict, optional) – A dictionary of transient data to associate with the output. Data in this dict should not be persisted to files (e.g. notebooks).
  • display_id (str, bool optional) – Set an id for the display. This id can be used for updating this display area later via update_display. If given as True, generate a new display_id
  • kwargs (additional keyword-args, optional) – Additional keyword-arguments are passed through to the display publisher.
Returns:

handle – Returns a handle on updatable displays for use withupdate_display(), if display_id is given. Returns None if no display_id is given (default).

Return type:

DisplayHandle

───

 

將可讀讀程式,開始想想怎麼寫也。

……