I need a professional python guy to help me modify the code

Job ID: 35001333

Budget: $10 – $30 USD

I need to add a judgment condition to detect whether the current image is open according to the image name, I need to write a python script,
For example, I have a 1.jpg image on my desktop. When executing the python script, it prompts "the picture is not opened", and when opening 1.jpg, it prompts "the picture is opened". When I execute the python script, it is detecting whether the 1.jpg image is open all the time
Related categories: Python Micropython