Make some working method to include a picture to a document


#1

It can be necessary to add an existing picture in a certain format such as .jpg, .gif, .png, etc. to a workbook. As far as I see, there is no working way to do it now.

It was suggested to use this code (does not work, skimage not found):

from skimage import io
url = 'https://upload.wikimedia.org/wikipedia/commons/thumb/8/81/Torus_cycles.svg/220px-Torus_cycles.svg.png
io.imread (url)
io.show()

and stackoverflow suggests this code (also does not work, PIL module is missed):

from urllib.request import urlretrieve
url = 'https://upload.wikimedia.org/wikipedia/commons/thumb/8/81/Torus_cycles.svg/220px-Torus_cycles.svg.png
urlretrieve (url, ‘pic.jpg’)
from PIL import Image
img = Image.open (‘pic.jpg’)
img.rotate (90).show()