# Reading an excel file using Python
import xlrd
from urllib.request import urlopen
from PIL import Image
from skimage import io
from io import BytesIO
# Give the location of the file
loc = ("F://Documents//Bridges//URLs.xlsx")
# To open Workbook
wb = xlrd.open_workbook(loc)
sheet = wb.sheet_by_index(0)
# input is requested and stored in a variable
row_start = input('Row Number = ')
# convert user input into an integer
x = int(row_start)
# Find URL
image_url = sheet.cell_value(x,0)
# Print URl
print (image_url)
#Buffer image as described in earlier answer to same question
response = urlopen('image_url')
buf = BytesIO(response.read())
im = Image.open(buf)
a = io.Image(im)
#Display image
io.imshow(a)
io.show()
# I get the following errors
#File "C:/Users/Wayne/PycharmProjects/untitled/URls2.py", line 29, in <module>
# response = urlopen('image_url')
# File "C:\Users\Wayne\AppData\Local\Programs\Python\Python38-32\lib\urllib\request.py", line 222,
в urlopen # вернуть opener.open (url, data, timeout) # Файл "C: \ Users \ Wayne \ AppData \ Local \ Programs \ Python \ Python38-32 \ lib \ urllib \ request. py ", строка 509, в открытом # req = Request (fullurl, data) # File" C: \ Users \ Wayne \ AppData \ Local \ Programs \ Python \ Python38-32 \ lib \ urllib \ request.py ", строка 328, в init # self.full_url = url # файл "C: \ Users \ Wayne \ AppData \ Local \ Programs \ Python \ Python38-32 \ lib \ urllib \ request.py", строка 354, в full_url # self._parse () # Файл "C: \ Users \ Wayne \ AppData \ Local \ Programs \ Python \ Python38-32 \ lib \ urllib \ request.py", строка 383, в _parse # повысить ValueError ("неизвестный тип URL:% r"% self.full_url) #ValueError: неизвестный тип URL: 'image_url'