Ask Your Question
1

How to load a local image from cloud.sagemath?

asked 11 years ago

jeanpat gravatar image

Hello, I tried naively to load an image in a worksheet from my cloud.sagemath account. Something like:

from scipy import ndimage as nd
image=nd.imread('~/path/to/image.jpg')

and of course that failed. Is there a way to do that?

thank you

jp

Preview: (hide)

Comments

In the Sage notebook, [this ask.sagemath question](http://ask.sagemath.org/question/1066/upload-data-file-to-notebook) should answer you. But maybe Sagemathcloud does it differently...

kcrisman gravatar imagekcrisman ( 11 years ago )

4 Answers

Sort by » oldest newest most voted
1

answered 11 years ago

ppurka gravatar image

You can try this

from scipy import ndimage as nd
image=nd.imread(os.environ['HOME'] + '/path/to/image.jpg')

where your image is located in $HOME/path/to/image.jpg

Preview: (hide)
link
0

answered 11 years ago

William Stein gravatar image

Your question is unclear. However, if you just want to display the image, do this

salvus.file('%s/path/to/image.jpg'%os.environ['HOME'])
Preview: (hide)
link
-1

answered 11 years ago

arronlee gravatar image

updated 11 years ago

ppurka gravatar image

remove spam

Preview: (hide)
link
-1

answered 11 years ago

updated 11 years ago

ppurka gravatar image

remove spam

Preview: (hide)
link

Comments

What does C# have to do with Sage and/or Python?

ppurka gravatar imageppurka ( 11 years ago )

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 11 years ago

Seen: 2,686 times

Last updated: Nov 25 '13