I don't know if there is an easy way of doing this that doesn't rely on manually writing down what the saved outputs from a script are so open to any suggestions. I want a function that runs at the end of my script and that automatically generates a text file with a name like: "IO_track_scriptname_date_time" Which has a list of the files I loaded and the files I saved (location links). And then saves this txt file to the desired destination.
Thank you for your help
Edit: Or any alternative way of keeping a log of inputs and outputs.
Here is a thin object wrapper around the
open
function that tracks all of the files that are opened.To actually use it, you will need to overwrite the built-in
open
function with an instantiation of this class. If you have one file that you are calling, you can pop this into the__main__
block. i.e.