Skip to content

deeppunster/Walk_vs_Scan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Walk_vs_Scan

Sample program to compare how to use Python’s os.walk vs. os.scandir to traverse a directory structure and time each method.

This is a self-contained program in Python to demonstrate how to use os .walk and os.scandir.

Included in this program are:

  • How to exclude directories (e.g. .git)
  • A simplified timer class based on the context manager.

Usage: NewWalkVsScan.py [-h] [-d ROOTDIR] [-o OUTPUT]

Test using os.walk vs. using os.scandir to traverse a directory structure.

optional arguments: -h, --help show this help message and exit -d ROOTDIR, --rootdir ROOTDIR root directory of tree to be traversed -o OUTPUT, --output OUTPUT output file to contain the results of walk vs. scan

About

Sample program to compare timing and how to use Python’s os.walk vs. os.scandir to traverse a directory structure.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages