So I’m trying to display the contents of a html file, but when I try to display it within a try except I don’t get anything. My
When I remove the try except it displays the file no problem. Why does this stop working once I put it in the try except?
import IPython try : num= rec.iloc[0,0][4:] file= '/content/init'+num+'.html' print(file) IPython.display.HTML(filename=file) except IndexError: print('select another!')
Source: Python Questions