My Python program generates an HTML page; how do I display a .jpg that's in the same directory?
No, your python process does not care about the JPG at all. It just generates html asking the browser to fetch the JPG. Then it's the browser, fetching the JPG by making another request to the webserver.
Therefore it is very likely that your python script needs to live in a different directory than the JPG. Have a look on your web server log. You should see two requests. One for the HTML and one for the JPG.
The generated HTML page works fine for text. But

does not find the file and displays the alt text instead. I know the HTML works because "view source" in the browser can be copied into a file, which then works locally when the .jpg is in the same directory.
On the remote site, the .jpg file is in the same directory as the Python program that generated the HTML, and this is the directory where the Python process is running. Clearly this process is looking for the file (it shows the alt); how do I find where it is looking, so I can put the file there? I would rather have a local reference than an absolute one elsewhere on the Web, to improve performance.