please help display an error message.
def download(path, name):
#urllib.URLopener().retrieve(prefix + path, name)
img = urllib.request.urlopen(prefix + path).read()
try:
f = open(name, "wb")
f.write(img)
except PermissionError:
print('PermissionError')
except:
print(error)
finally:
f.close()
in the case of a failed write the script writes
PermissionError
but if there is another error, I need to display full information about error. not
error
is it possible to implement?