How to load a local image to gpt4 -vision using API

I see that you are attempting to write a python script. I occasionally enjoy writing Python also.

I hope that meets your needs and informs where next to go with your own endeavors.