Badger Errno 2

Hello!

just starting out on a badger, trying to upload an image but getting stuck running the convert.py sketch

I created the sketch and added it to a folder along with the image I was converting, copied in %Run convert.py --resize --binary image_file_1.png (changing the file name) into the shell and all I get is an errno 2 error

ive copied the name exactly in the line but nothing changes, same thing happens in the terminal.

Any advice?

Im used to arduinos and its IDE so still learning thonnys quirks

cheers

Joe

Are you running Python 3 or Pi Pico?

Switch your interpreter to ‘The same interpreter which runs Thonny (default)’ using the box at the bottom right. This tells it to use Thonny’s full fat version of Python, instead of Badger’s version of MicroPython.

yeah im switching it over to “local python 3 -thonnys python”

this does seem to be a strange intermittent fault as it was working for a about 20 mins before throwing up errno 21’s

Dug out my Badger and tried to convert a jpg. Took a good few tries but it eventually worked.

>>> %Run convert.py --binary MDuck2.jpg Duck.bin
Saving to MDuck2.bin, 296x128
Traceback (most recent call last):
  File "D:\Mr Goodhew\Documents\PICO - MP\Badger 2040 -Pimoroni Badge\Images\convert.py", line 104, in <module>
    with Image.open(input_filename) as img:
  File "C:\Users\Mr Goodhew\AppData\Roaming\Python\Python310\site-packages\PIL\Image.py", line 3227, in open
    fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'Duck.bin'

Produced some errors after doing the necessary work. No idea why. I found that if the file was already the correct size you need to leave out the resize part, and you need to put the required filename, ending ***.bin on the end.

Took me ages to get everything right.

================
Just converted another one and got the after saving errors again. I can live with that.

It is easier on the Badger 2040 W as that takes jpgs of the correct size as input.