I need to retrieve all the filenames ending with .xml extension from all the subdirectories present in a directory and copy those names into a new .xml file.

Recommended Answers

Have look at the os.walk() function.

Jump to Post

All 2 Replies

Have look at the os.walk() function.

I assume you need the full pathname of each file.

Python module glob will help you.