There may be many instances when you want to search a system.Suppose while writing an mp3 player you may want to have all the ‘.mp3’ files present. Well here’s how to do it in a simple way.
This code searches all the folders in the file it’s being run. If you want some other kinds of files just change the extension.
os is not an external ibrary in python. So I feel this is the simplest and the best way to do this.
This article is contributed by soumith kumar. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- reStructuredText | .rst file to HTML file using Python for Documentations
- Reading Python File-Like Objects from C | Python
- File Handling in Python
- Python | Kivy .kv File
- File Objects in Python
- Python | Create checkbox using .kv file
- Python | AnchorLayout in Kivy using .kv file
- Python | StackLayout in Kivy using .kv file
- How to get the permission mask of a file in Python
- Python Program to delete a file
- Python | ScreenManager in Kivy using .kv file
- Python | Slider widget using .kv file
- Python | FloatLayout in Kivy using .kv file
- Python | Canvas in Kivy using .kv file
- Junk File Organizer in Python