Skip to content

Python code snippet – How to get files list from active directory from where the script is running?

import os

for root, dirs, files in os.walk("."):
    for filename in files:
        print(filename)
See also  Python code snippet - How to remove the last item in a list ?
, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.