find_am_png.py 688 B

1234567891011121314151617181920212223
  1. import os
  2. search_paths = [
  3. r"c:\Users\lanfr144\Documents\DOPRO1",
  4. r"c:\Users\lanfr144\Documents",
  5. r"c:\Users\lanfr144"
  6. ]
  7. found_paths = []
  8. for base_path in search_paths:
  9. if not os.path.exists(base_path):
  10. continue
  11. print(f"Searching in {base_path}...")
  12. for root, dirs, files in os.walk(base_path):
  13. # Limit search depth to avoid extremely long runtime
  14. if root.count(os.sep) - base_path.count(os.sep) > 4:
  15. continue
  16. if "am.png" in files:
  17. found_path = os.path.join(root, "am.png")
  18. found_paths.append(found_path)
  19. print(f"FOUND: {found_path}")
  20. print("Search complete. Found:", found_paths)