How can I find all the files in a directory having the extension .txt
in python?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
I suggest you to use fnmatch and the upper method. In this way you can find any of the following:
.
path.py is another alternative: https://github.com/jaraco/path.py
This code makes my life simpler.
To get all '.txt' file names inside 'dataPath' folder as a list in a Pythonic way