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>?
#1
Hello,

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
Reply
#2
(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.
Reply
#3
Got it. Thank you.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to display combobox related values in labels Lalremruata 0 146 Jul-20-2021, 02:45 AM
Last Post: Lalremruata
  reading html and edit chekcbox to html jacklee26 5 371 Jul-01-2021, 10:31 AM
Last Post: snippsat
  Segmentation fault (core dumped) hobbyist 1 384 Jun-07-2021, 12:56 PM
Last Post: supuflounder
  Python script in Ubuntu core Nithin_Kumar 1 720 May-11-2021, 01:14 AM
Last Post: Skaperen
  how to suppress not to display the package contents from pydoc! maiya 3 544 Mar-19-2021, 03:41 AM
Last Post: bowlofred
Information Unable to display joystick's value from Python onto display box MelfoyGray 2 489 Nov-11-2020, 02:23 AM
Last Post: MelfoyGray
  display the result of Dataframe in tabulate format alex80 0 432 Sep-09-2020, 02:22 PM
Last Post: alex80
  matplotlib for better waveform display jefflawr 0 507 Aug-14-2020, 01:39 AM
Last Post: jefflawr
  pyautogui with a display emulator? gumby4231 0 759 Jul-30-2020, 02:46 PM
Last Post: gumby4231
  display single elements in array davidm 3 707 Jul-26-2020, 07:32 AM
Last Post: davidm

Forum Jump:

User Panel Messages

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