Ask Your Question

Display a PNG image file in a worksheet

asked 2012-05-12 10:08:10 -0600

TSchwenn gravatar image

updated 2012-05-12 10:28:32 -0600

I've uploaded an image file (DATA+'foo.png') into a notebook worksheet. How can I display it in the worksheet? I've tried using the statement


but it just returns the file's path:


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2012-05-12 16:06:15 -0600

kcrisman gravatar image

updated 2015-05-08 16:09:56 -0600

How do you want to show it? The command you gave is showing a string (DATA is a Python string), so that is why that doesn't work.

To just insert the image, use the TinyMCE GUI editor (shift-click on a blue "new cell" line). Full instructions were at Mike May's great worksheet, where you don't even need the DATA variable to use the image link; this is just doing the same thing.

This is what I think you mean - see these screen captures. Basically, you upload the file, and then in the TinyMCE editor you click on the picture icon and put just the name of the file in as your picture file name. Here I uploaded a picture of your question into my worksheet.

image description

image description

image description

image description

I imagine that you could also get it to show up by inserting some HTML into a cell with html() and using an <img> tag or something?

edit flag offensive delete link more


Both, the link and the image do not work...

sageMathUser gravatar imagesageMathUser ( 2015-05-06 17:26:27 -0600 )edit

This is true, since sagenb public worksheets are down. I'm not sure why the image doesn't work.

kcrisman gravatar imagekcrisman ( 2015-05-08 10:55:06 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-05-12 10:08:10 -0600

Seen: 1,030 times

Last updated: May 08 '15