Skip to content

Instantly share code, notes, and snippets.

@Bailey3D
Last active December 28, 2019 15:00
Show Gist options
  • Save Bailey3D/d86ef82f0802c0fb1923a2c57e170032 to your computer and use it in GitHub Desktop.
Save Bailey3D/d86ef82f0802c0fb1923a2c57e170032 to your computer and use it in GitHub Desktop.
Step through all files on a drive
import os, win32api
drives = win32api.GetLogicalDriveStrings()
drives = drives.split("\000")[:-1]
path = "D:\\"
files = []
for r, d, f in os.walk(path):
for file in f:
print(os.path.join(r, file))
print("Complete!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment