Can I determine which sketch is currently loaded on my Uno?

cossoft:
positive feedback that the source you're looking at is actually being executed.

That is the exact purpose of my Python code. And it goes further as in the archive it includes copies of all external libraries that are used so that I can be sure if I re-compile the code it is using the same libraries as previously.

I did not build into my program a record of the version of the IDE being used to compile the code - it would be a good idea to have that also.

...R

The ARDUINO macro contains the IDE version. For example, if you're compiling with Arduino IDE 1.8.8, ARDUINO will be 10808. The zero padding on the minor and patch version is to allow them to go into double digits without messing up the numerical sequence (10810 < 10900). This definition comes from the IDE's runtime.ide.version property so you could easily add a build hook to write that value to a metadata file.

Thanks @pert, that's useful to know.

In my Python program you must specify the IDE version so it knows which one to use so it could easily include that in the Archive name. I just never thought of doing it until now.

...R