Skip to content
This repository has been archived by the owner on Sep 28, 2019. It is now read-only.

happy cat path is wrong #29

Closed
NeilHendrick opened this issue Sep 28, 2018 · 1 comment
Closed

happy cat path is wrong #29

NeilHendrick opened this issue Sep 28, 2018 · 1 comment

Comments

@NeilHendrick
Copy link

There is a small error in the example scripts when trying to display images. The images are referred to without a path, and the result is that the script will crash when trying to display the referenced image.

For example,
IOError: [Errno 2] No such file or directory: 'happycat_oled_32.ppm'

To fix this, I simply edited the buttons.py script at line 154 with an absolute path to the image file.
It was 👍
catImage = Image.open('happycat_oled_64.ppm').convert('1')

Changed to:
catImage = Image.open('/home/pi/Adafruit_Python_SSD1306/examples/happycat_oled_64.ppm').convert('1')

now, it works fine.

@ladyada
Copy link
Member

ladyada commented Sep 28, 2018

it depends on the directory you're running from - you should have it in the same directory you're running the script!

@ladyada ladyada closed this as completed Sep 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants