From b26da9bdb6f4b205d50882b19e32c66540b7607d Mon Sep 17 00:00:00 2001 From: Jeremy Odekirk Date: Mon, 17 Apr 2017 12:54:58 -0500 Subject: [PATCH] Add error checking code to image file input if image file doesn't exist display a user friendly error. --- 3. O'Reilly Generate from image.ipynb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/3. O'Reilly Generate from image.ipynb b/3. O'Reilly Generate from image.ipynb index 7d1b1da..9089244 100644 --- a/3. O'Reilly Generate from image.ipynb +++ b/3. O'Reilly Generate from image.ipynb @@ -89,7 +89,9 @@ }, "outputs": [], "source": [ - "image_path = './image_path.jpg'" + "image_path = './image_path.jpg'\n", + "if not os.path.exists(image_path):\n", + " print ('Error: image_path not found. Change image_path to image requiring captions.')" ] }, {