Python Forum
How to display <IPython.core.display.HTML object>?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to display <IPython.core.display.HTML object>?

I am using Python 3.6.5.

When I run the following code,
from IPython.display import display, HTML

display(HTML('<h1>Hello, world!</h1>'))

I only get: <IPython.core.display.HTML object>

Do I miss something? Wall
(Oct-16-2018, 08:47 PM)pythopen Wrote: Do I miss something?
Yes Jupyter Notebook
You can only render HTML in a browser,and not in a Python console/editor environment.
Can call .data to see html,but it will not render.
In [17]: from IPython.display import display, HTML

In [18]: display(HTML('<h1>Hello, world!</h1>').data)
'<h1>Hello, world!</h1>'
Rich Output examples in Jupyter Notebook.
Got it. Thank you.

Possibly Related Threads…
Thread Author Replies Views Last Post
  Writing on an lcd display gives problems to the program Idontknowany 1 180 Nov-15-2021, 10:46 PM
Last Post: Larz60+
  How to get OpenCV to display entire camera frame? George713 1 554 Aug-12-2021, 02:45 AM
Last Post: Pedroski55
  Display table field on multiple lines, 'wordwrap' 3python 0 348 Aug-06-2021, 08:17 PM
Last Post: 3python
  How to display combobox related values in labels Lalremruata 0 481 Jul-20-2021, 02:45 AM
Last Post: Lalremruata
  reading html and edit chekcbox to html jacklee26 5 896 Jul-01-2021, 10:31 AM
Last Post: snippsat
  Segmentation fault (core dumped) hobbyist 1 870 Jun-07-2021, 12:56 PM
Last Post: supuflounder
  Python script in Ubuntu core Nithin_Kumar 1 1,172 May-11-2021, 01:14 AM
Last Post: Skaperen
  how to suppress not to display the package contents from pydoc! maiya 3 858 Mar-19-2021, 03:41 AM
Last Post: bowlofred
Information Unable to display joystick's value from Python onto display box MelfoyGray 2 766 Nov-11-2020, 02:23 AM
Last Post: MelfoyGray
  display the result of Dataframe in tabulate format alex80 0 579 Sep-09-2020, 02:22 PM
Last Post: alex80

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020