Showing posts with label Directory. Show all posts
Showing posts with label Directory. Show all posts

Lisiting particular type of files in a directory

import os
Path = os.getcwd()
Names= os.listdir(Path)
h=raw_input('Enter the file type extension: ')
for n in Names:
      if h in n:
            print n