Skip to content

Instantly share code, notes, and snippets.

@s3afroze
Created August 20, 2018 15:18
Show Gist options
  • Save s3afroze/80642159559979e627a645529fe3a296 to your computer and use it in GitHub Desktop.
Save s3afroze/80642159559979e627a645529fe3a296 to your computer and use it in GitHub Desktop.
How to get a file anywhere in the computer?
f = 'filename'
for path, dirs, files in os.walk('.'):
if f in files:
os.chdir(path)
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment