Standard Posted by airtoncomp Posted on 10/06/2017 Posted under Linux, Unix Programming Comments Leave a comment Python package glob: How to get a list of files under a directory? Original post here. import glob print(glob.glob("/home/adam/*.txt")) Will return a list with the queried files: ['/home/user/file1.txt', '/home/user/file2.txt', .... ] Like this:Like Loading... Related directoryfilesgloblinuxlistopenpackageprogrammingpythonubuntu Post navigation ← HP Device Manager to Scan Docs Leave a Reply Cancel reply Enter your comment here... Fill in your details below or click an icon to log in: Email (required) (Address never made public) Name (required) Website You are commenting using your WordPress.com account. ( Log Out / Change ) You are commenting using your Twitter account. ( Log Out / Change ) You are commenting using your Facebook account. ( Log Out / Change ) You are commenting using your Google+ account. ( Log Out / Change ) Cancel Connecting to %s Notify me of new comments via email.