Sep-20-2020, 01:18 AM
Hey everyone,
Here is a function I made to check if files exist.
Thanks
Here is a function I made to check if files exist.
def chkFile(filesPath): if hasattr(filesPath, "__len__"): for i in filesPath: if not path.exists(i): return False return True else: return path.exists(filesPath)it works great for files in the main directories, and subdirectories. However I am trying to get it to recognize a file located in /sys/bus/w1/devices/, which is nowhere near my working dir. anyone know how I can change this to accept absolute dir's?
Thanks