May-02-2024, 06:02 AM
I would not lie, I Googled it and I do not understand it. I actually come up with a "readable' one and it works.
I'm not sure if it is a good code or not. Sorry about that!
I'm not sure if it is a good code or not. Sorry about that!
lst_ogs = [] for item in Path(host_path).iterdir() : if item.is_file() : fname = Path(item).name #print(f" .. {fname}") if fname.startswith("some_log") : lst_ogs.append(item) lst_ogs.sort(key=os.path.getmtime,reverse=True)Thank you!