python monitor directory for files count

Solutions on MaxInterview for python monitor directory for files count by the best coders in the world

showing results for - "python monitor directory for files count"
Jeanne
20 May 2016
1import os.path
2path = os.getenv('HOME') + '/python'
3num_files = len([f for f in os.listdir(path)if os.path.isfile(os.path.join(path, f))])
4